Skip to content

Commit

Permalink
feat: endpoint execute schedule permission [BACKLOG-40051] (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrasil authored Mar 22, 2024
1 parent 6f4847f commit f232a34
Show file tree
Hide file tree
Showing 4 changed files with 266 additions and 224 deletions.
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

0 comments on commit f232a34

Please sign in to comment.