Search in sources :

Example 1 with YOU_DO_NOT_HAVE_PERMISSION_TO_DO_THIS_OPERATION

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;
}
Also used : JobId(org.ow2.proactive.scheduler.common.job.JobId) FileSystemException(org.objectweb.proactive.extensions.dataspaces.exceptions.FileSystemException) KeyException(java.security.KeyException) UnknownJobException(org.ow2.proactive.scheduler.common.exception.UnknownJobException) TaskCouldNotRestartException(org.ow2.proactive.scheduler.common.exception.TaskCouldNotRestartException) InvalidChannelException(org.ow2.proactive.scheduler.synchronization.InvalidChannelException) JobCreationException(org.ow2.proactive.scheduler.common.exception.JobCreationException) PermissionException(org.ow2.proactive.scheduler.common.exception.PermissionException) NotConnectedException(org.ow2.proactive.scheduler.common.exception.NotConnectedException) AlreadyConnectedException(org.ow2.proactive.scheduler.common.exception.AlreadyConnectedException) UnknownTaskException(org.ow2.proactive.scheduler.common.exception.UnknownTaskException) TaskCouldNotStartException(org.ow2.proactive.scheduler.common.exception.TaskCouldNotStartException) JobValidationException(org.ow2.proactive.scheduler.common.exception.JobValidationException) JobAlreadyFinishedException(org.ow2.proactive.scheduler.common.exception.JobAlreadyFinishedException) SubmissionClosedException(org.ow2.proactive.scheduler.common.exception.SubmissionClosedException) DatabaseManagerException(org.ow2.proactive.db.DatabaseManagerException) TaskSkippedException(org.ow2.proactive.scheduler.common.exception.TaskSkippedException) ProActiveException(org.objectweb.proactive.core.ProActiveException) SignalApiException(org.ow2.proactive.scheduler.signal.SignalApiException) ImmediateService(org.objectweb.proactive.annotation.ImmediateService)

Example 2 with YOU_DO_NOT_HAVE_PERMISSION_TO_DO_THIS_OPERATION

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;
}
Also used : JobId(org.ow2.proactive.scheduler.common.job.JobId) FileSystemException(org.objectweb.proactive.extensions.dataspaces.exceptions.FileSystemException) KeyException(java.security.KeyException) UnknownJobException(org.ow2.proactive.scheduler.common.exception.UnknownJobException) TaskCouldNotRestartException(org.ow2.proactive.scheduler.common.exception.TaskCouldNotRestartException) InvalidChannelException(org.ow2.proactive.scheduler.synchronization.InvalidChannelException) JobCreationException(org.ow2.proactive.scheduler.common.exception.JobCreationException) PermissionException(org.ow2.proactive.scheduler.common.exception.PermissionException) NotConnectedException(org.ow2.proactive.scheduler.common.exception.NotConnectedException) AlreadyConnectedException(org.ow2.proactive.scheduler.common.exception.AlreadyConnectedException) UnknownTaskException(org.ow2.proactive.scheduler.common.exception.UnknownTaskException) TaskCouldNotStartException(org.ow2.proactive.scheduler.common.exception.TaskCouldNotStartException) JobValidationException(org.ow2.proactive.scheduler.common.exception.JobValidationException) JobAlreadyFinishedException(org.ow2.proactive.scheduler.common.exception.JobAlreadyFinishedException) SubmissionClosedException(org.ow2.proactive.scheduler.common.exception.SubmissionClosedException) DatabaseManagerException(org.ow2.proactive.db.DatabaseManagerException) TaskSkippedException(org.ow2.proactive.scheduler.common.exception.TaskSkippedException) ProActiveException(org.objectweb.proactive.core.ProActiveException) SignalApiException(org.ow2.proactive.scheduler.signal.SignalApiException) ImmediateService(org.objectweb.proactive.annotation.ImmediateService)

Aggregations

KeyException (java.security.KeyException)2 ImmediateService (org.objectweb.proactive.annotation.ImmediateService)2 ProActiveException (org.objectweb.proactive.core.ProActiveException)2 FileSystemException (org.objectweb.proactive.extensions.dataspaces.exceptions.FileSystemException)2 DatabaseManagerException (org.ow2.proactive.db.DatabaseManagerException)2 AlreadyConnectedException (org.ow2.proactive.scheduler.common.exception.AlreadyConnectedException)2 JobAlreadyFinishedException (org.ow2.proactive.scheduler.common.exception.JobAlreadyFinishedException)2 JobCreationException (org.ow2.proactive.scheduler.common.exception.JobCreationException)2 JobValidationException (org.ow2.proactive.scheduler.common.exception.JobValidationException)2 NotConnectedException (org.ow2.proactive.scheduler.common.exception.NotConnectedException)2 PermissionException (org.ow2.proactive.scheduler.common.exception.PermissionException)2 SubmissionClosedException (org.ow2.proactive.scheduler.common.exception.SubmissionClosedException)2 TaskCouldNotRestartException (org.ow2.proactive.scheduler.common.exception.TaskCouldNotRestartException)2 TaskCouldNotStartException (org.ow2.proactive.scheduler.common.exception.TaskCouldNotStartException)2 TaskSkippedException (org.ow2.proactive.scheduler.common.exception.TaskSkippedException)2 UnknownJobException (org.ow2.proactive.scheduler.common.exception.UnknownJobException)2 UnknownTaskException (org.ow2.proactive.scheduler.common.exception.UnknownTaskException)2 JobId (org.ow2.proactive.scheduler.common.job.JobId)2 SignalApiException (org.ow2.proactive.scheduler.signal.SignalApiException)2 InvalidChannelException (org.ow2.proactive.scheduler.synchronization.InvalidChannelException)2