Search in sources :

Example 1 with ChangePolicyPermission

use of org.ow2.proactive.scheduler.permissions.ChangePolicyPermission in project scheduling by ow2-proactive.

the class SchedulerFrontendState method checkChangePolicy.

synchronized void checkChangePolicy() throws NotConnectedException, PermissionException {
    UniqueID id = checkAccess();
    UserIdentificationImpl ident = identifications.get(id).getUser();
    // renew session for this user
    renewUserSession(id, ident);
    try {
        ident.checkPermission(new ChangePolicyPermission(), ident.getUsername() + " does not have permissions to change the policy of the scheduler");
    } catch (PermissionException ex) {
        logger.info(ex.getMessage());
        throw ex;
    }
}
Also used : PermissionException(org.ow2.proactive.scheduler.common.exception.PermissionException) UniqueID(org.objectweb.proactive.core.UniqueID) ChangePolicyPermission(org.ow2.proactive.scheduler.permissions.ChangePolicyPermission) UserIdentificationImpl(org.ow2.proactive.scheduler.job.UserIdentificationImpl)

Aggregations

UniqueID (org.objectweb.proactive.core.UniqueID)1 PermissionException (org.ow2.proactive.scheduler.common.exception.PermissionException)1 UserIdentificationImpl (org.ow2.proactive.scheduler.job.UserIdentificationImpl)1 ChangePolicyPermission (org.ow2.proactive.scheduler.permissions.ChangePolicyPermission)1