Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addresses BACKLOG-40051: new endpoint execute schedule permission #144

Merged
merged 4 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -606,13 +606,39 @@ public String isScheduleAllowed( @QueryParam( "id" ) String id ) {
@Path( "/canSchedule" )
@Produces( APPLICATION_JSON )
@StatusCodes( {
@ResponseCode( code = 200, condition = "Successful retrieved the scheduling permission." ),
@ResponseCode( code = 200, condition = "Successfully retrieved the scheduling permission." ),
@ResponseCode( code = 500, condition = "Unable to retrieve the scheduling permission." )
} )
public String doGetCanSchedule() {
return schedulerService.doGetCanSchedule();
}

/**
* Checks whether the current user has authority to execute schedules in the platform.
*
* <p><b>Example Request:</b><br />
* GET pentaho/api/scheduler/canExecuteSchedules
* </p>
*
* <p><b>Example Response:</b></p>
* <pre function="syntax.xml">
* true
* </pre>
*
* @return true or false. true indicates schedule execution is allowed and false indicates schedule execution is
* not allowed for the user.
*/
@GET
@Path( "/canExecuteSchedules" )
@Produces( APPLICATION_JSON )
@StatusCodes( {
@ResponseCode( code = 200, condition = "Successfully retrieved the scheduling permission." ),
@ResponseCode( code = 500, condition = "Unable to retrieve the scheduling permission." )
} )
public String doGetCanExecuteSchedules() {
return schedulerService.doGetCanExecuteSchedule();
}

/**
* Returns the state of the scheduler with the value of RUNNING or PAUSED.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
*/
public interface ISchedulerServicePlugin {
/*
* TODO I don't think createJob actually throws IOException. look into changing IOException, SchedulerException, IllegalAccessException, -> SchedulerException,
* TODO I don't think createJob actually throws IOException. look into changing IOException, SchedulerException,
* IllegalAccessException, -> SchedulerException,
*/
Job createJob( JobScheduleRequest jobScheduleRequest ) throws IOException, SchedulerException, IllegalAccessException;

Expand All @@ -67,6 +68,8 @@ public interface ISchedulerServicePlugin {

String doGetCanSchedule();

String doGetCanExecuteSchedule();

String getState() throws SchedulerException;

String start() throws SchedulerException;
Expand Down
Loading