public void removeOperation( Operation operation ) throws RbacObjectNotFoundException, RbacManagerException { RBACObjectAssertions.assertValid( "Remove Operation", operation ); if ( operation.isPermanent() ) { throw new RbacPermanentException( "Unable to delete permanent operation [" + operation.getName() + "]" ); } assertOpertionExists( operation.getName() ); operations.remove( operation.getName() ); }
public void removeResource( Resource resource ) throws RbacObjectNotFoundException, RbacManagerException { RBACObjectAssertions.assertValid( "Remove Resource", resource ); if ( resource.isPermanent() ) { throw new RbacPermanentException( "Unable to delete permanent resource [" + resource.getIdentifier() + "]" ); } assertResourceExists( resource.getIdentifier() ); resources.remove( resource.getIdentifier() ); }
public void removePermission( Permission permission ) throws RbacObjectNotFoundException, RbacManagerException { RBACObjectAssertions.assertValid( "Remove Permission", permission ); if ( permission.isPermanent() ) { throw new RbacPermanentException( "Unable to delete permanent permission [" + permission.getName() + "]" ); } assertPermissionExists( permission.getName() ); fireRbacPermissionRemoved( permission ); permissions.remove( permission.getName() ); }
public void removeRole( Role role ) throws RbacManagerException, RbacObjectNotFoundException { RBACObjectAssertions.assertValid( "Remove Role", role ); if ( role.isPermanent() ) { throw new RbacPermanentException( "Unable to delete permanent role [" + role.getName() + "]" ); } assertRoleExists( role.getName() ); fireRbacRoleRemoved( role ); roles.remove( role.getName() ); }
public void removeUserAssignment( UserAssignment userAssignment ) throws RbacObjectNotFoundException, RbacManagerException { RBACObjectAssertions.assertValid( "Remove User Assignment", userAssignment ); if ( userAssignment.isPermanent() ) { throw new RbacPermanentException( "Unable to delete permanent user assignment [" + userAssignment.getPrincipal() + "]" ); } fireRbacUserAssignmentRemoved( userAssignment ); assertUserAssignmentExists( userAssignment.getPrincipal() ); userAssignments.remove( userAssignment.getPrincipal() ); }
public void removeRole( Role role ) throws RbacManagerException { RBACObjectAssertions.assertValid( role ); if ( role.isPermanent() ) { throw new RbacPermanentException( "Unable to delete permanent role [" + role.getName() + "]" ); } rolesCache.remove( role.getName() ); if ( writableLdap ) { LdapConnection ldapConnection = null; DirContext context = null; try { ldapConnection = ldapConnectionFactory.getConnection(); context = ldapConnection.getDirContext(); ldapRoleMapper.removeRole( role.getName(), context ); } catch ( MappingException e ) { throw new RbacManagerException( e.getMessage(), e ); } catch ( LdapException e ) { throw new RbacManagerException( e.getMessage(), e ); } fireRbacRoleRemoved( role ); } }