public Map<String, Role> getRoles( Collection<String> roleNames ) throws RbacObjectNotFoundException, RbacManagerException { Map<String, Role> roleMap = new HashMap<String, Role>(); for ( String roleName : roleNames ) { Role child = getRole( roleName ); roleMap.put( child.getName(), child ); } return roleMap; } }
public void removeRole( String roleName ) throws RbacObjectNotFoundException, RbacManagerException { removeRole( getRole( roleName ) ); }
public List<Role> getAllAssignableRoles() throws RbacManagerException, RbacObjectNotFoundException { List<Role> assignableRoles = new ArrayList<Role>(); for ( Role r : getAllRoles() ) { Role role = getRole( r.getName() ); if ( role.isAssignable() ) { assignableRoles.add( role ); } } return assignableRoles; }
try Role role = getRole( roleName );
public Collection<Role> getEffectivelyAssignedRoles( UserAssignment ua ) throws RbacObjectNotFoundException, RbacManagerException { Set<Role> roleSet = new HashSet<Role>(); if ( ua != null && ua.getRoleNames() != null ) { boolean childRoleNamesUpdated = false; Iterator<String> it = ua.getRoleNames().listIterator(); while ( it.hasNext() ) { String roleName = it.next(); try { Role role = getRole( roleName ); gatherEffectiveRoles( role, roleSet ); } catch ( RbacObjectNotFoundException e ) { // Found a bad role name. remove it! it.remove(); childRoleNamesUpdated = true; } } if ( childRoleNamesUpdated ) { saveUserAssignment( ua ); } } return roleSet; }
Role crole = getRole( roleName );
try Role child = getRole( roleName );
try Role role = getRole( roleName ); gatherUniquePermissions( role, permissionSet );