Search in sources :

Example 1 with ConnectToResourceManagerPermission

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

the class SchedulerFrontendState method checkLinkResourceManager.

synchronized void checkLinkResourceManager() throws NotConnectedException, PermissionException {
    UniqueID id = checkAccess();
    UserIdentificationImpl ident = identifications.get(id).getUser();
    // renew session for this user
    renewUserSession(id, ident);
    try {
        ident.checkPermission(new ConnectToResourceManagerPermission(), ident.getUsername() + " does not have permissions to change RM in 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) ConnectToResourceManagerPermission(org.ow2.proactive.scheduler.permissions.ConnectToResourceManagerPermission) 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 ConnectToResourceManagerPermission (org.ow2.proactive.scheduler.permissions.ConnectToResourceManagerPermission)1