use of org.ow2.proactive.scheduler.core.SchedulerFrontendState.YOU_DO_NOT_HAVE_PERMISSION_TO_DO_THIS_OPERATION in project scheduling by ow2-proactive.
the class SchedulerFrontend method checkJobPermissionMethod.
@Override
@ImmediateService
public boolean checkJobPermissionMethod(String jobId, String method) {
try {
JobId id = JobIdImpl.makeJobId(jobId);
frontendState.checkPermissions(method, frontendState.getIdentifiedJob(id), YOU_DO_NOT_HAVE_PERMISSION_TO_DO_THIS_OPERATION);
} catch (Exception p) {
return false;
}
return true;
}
use of org.ow2.proactive.scheduler.core.SchedulerFrontendState.YOU_DO_NOT_HAVE_PERMISSION_TO_DO_THIS_OPERATION in project scheduling by ow2-proactive.
the class SchedulerFrontend method checkJobsPermissionMethod.
@Override
@ImmediateService
public List<String> checkJobsPermissionMethod(List<String> jobIds, String method) {
List<String> answer = new ArrayList<>();
if (jobIds != null) {
for (String jobId : jobIds) {
try {
JobId id = JobIdImpl.makeJobId(jobId);
frontendState.checkPermissions(method, frontendState.getIdentifiedJob(id), YOU_DO_NOT_HAVE_PERMISSION_TO_DO_THIS_OPERATION);
answer.add(jobId);
} catch (Exception p) {
// not authorized
}
}
}
return answer;
}
Aggregations