Search in sources :

Example 11 with RbacObjectNotFoundException

use of org.apache.archiva.redback.rbac.RbacObjectNotFoundException in project archiva by apache.

the class AbstractSecurityTest method restoreGuestInitialValues.

protected void restoreGuestInitialValues(String userId) throws Exception {
    UserAssignment userAssignment = null;
    try {
        userAssignment = rbacManager.getUserAssignment(userId);
    } catch (RbacObjectNotFoundException e) {
        log.info("ignore RbacObjectNotFoundException for id {} during restoreGuestInitialValues", userId);
        return;
    }
    userAssignment.setRoleNames(Lists.newArrayList("Guest"));
    rbacManager.saveUserAssignment(userAssignment);
    CacheManager.getInstance().clearAll();
}
Also used : UserAssignment(org.apache.archiva.redback.rbac.UserAssignment) RbacObjectNotFoundException(org.apache.archiva.redback.rbac.RbacObjectNotFoundException)

Aggregations

RbacObjectNotFoundException (org.apache.archiva.redback.rbac.RbacObjectNotFoundException)11 RepositoryAdminException (org.apache.archiva.admin.model.RepositoryAdminException)10 AbstractRBACManager (org.apache.archiva.redback.rbac.AbstractRBACManager)10 RBACManager (org.apache.archiva.redback.rbac.RBACManager)10 RbacManagerException (org.apache.archiva.redback.rbac.RbacManagerException)10 RbacObjectInvalidException (org.apache.archiva.redback.rbac.RbacObjectInvalidException)10 UserAssignment (org.apache.archiva.redback.rbac.UserAssignment)2 Operation (org.apache.archiva.redback.rbac.Operation)1 Permission (org.apache.archiva.redback.rbac.Permission)1 Resource (org.apache.archiva.redback.rbac.Resource)1 Role (org.apache.archiva.redback.rbac.Role)1