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

[PDI-19868] - Schedule perspective for the Administrator Role is different between PUC and PDI #5423

Merged
merged 1 commit into from
Nov 2, 2023
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 @@ -123,7 +123,16 @@ public Job[] getJobs() throws SchedulerException {
/** {@inheritDoc} */
public void pause() throws SchedulerException {
IScheduler scheduler = PentahoSystem.get( IScheduler.class, "IScheduler2", null ); //$NON-NLS-1$
scheduler.pause();
if(PentahoSystem.get( IAuthorizationPolicy.class ).isAllowed( ADMIN_PERM )) {
scheduler.pause();
}else {
throw new SchedulerException( "Operation not allowed" );
}
}

@Override
public boolean canStopScheduler() {
return PentahoSystem.get( IAuthorizationPolicy.class ).isAllowed( ADMIN_PERM );
}

/** {@inheritDoc} */
Expand All @@ -141,7 +150,12 @@ public void removeJob( String jobId ) throws SchedulerException {
/** {@inheritDoc} */
public void start() throws SchedulerException {
IScheduler scheduler = PentahoSystem.get( IScheduler.class, "IScheduler2", null ); //$NON-NLS-1$
scheduler.start();
if (PentahoSystem.get( IAuthorizationPolicy.class ).isAllowed( ADMIN_PERM )) {
scheduler.start();
} else {
throw new SchedulerException( "Operation not allowed" );
}

}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,7 @@ public String updateJobComplexTriggerWithJobName( String jobName, String jobId,
*/
public int getSchedulerStatus() throws SchedulerException;

default public boolean canStopScheduler (){
return true;
}
}
Loading