public String getName() { return this.role.getName(); }
public void addRoleName( Role role ) { if ( role == null ) { return; } this.roleNames.add( role.getName() ); }
public void removeRoleName( Role role ) { if ( role == null ) { return; } this.roleNames.remove( role.getName() ); }
private org.apache.archiva.redback.rbac.Role isInList( String roleName, Collection<org.apache.archiva.redback.rbac.Role> roles ) { for ( org.apache.archiva.redback.rbac.Role role : roles ) { if ( roleName.equals( role.getName() ) ) { return role; } } return null; }
private List<String> toRoleNames( Collection<org.apache.archiva.redback.rbac.Role> roles ) { List<String> names = new ArrayList<String>( roles.size() ); for ( org.apache.archiva.redback.rbac.Role r : roles ) { names.add( r.getName() ); } return names; }
@Override public boolean roleExists( Role role ) throws RbacManagerException { return roleExists( role.getName() ); }
@Override public boolean roleExists( Role role ) throws RbacManagerException { return roleExists( role.getName() ); }
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; } }
@Override public boolean roleExists( Role role ) throws RbacManagerException { if ( role == null ) { return false; } return roleExists( role.getName() ); }
protected List<String> getRealRoles() throws RbacManagerException { List<Role> roles = this.rbacImpl.getAllRoles(); List<String> roleNames = new ArrayList<String>( roles.size() ); for ( Role role : roles ) { roleNames.add( role.getName() ); } return roleNames; }
public void addRoleName( Role role ) { addRoleName( role.getName() ); }
public void removeRoleName( Role role ) { removeRoleName( role.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 addChildRole( Role role, Role childRole ) throws RbacObjectInvalidException, RbacManagerException { saveRole( childRole ); role.addChildRoleName( childRole.getName() ); }
public boolean roleExists( Role role ) throws RbacManagerException { if ( rolesCache.hasKey( role.getName() ) ) { return true; } return this.rbacImpl.roleExists( role ); }
private void invalidateCachedRole( Role role ) { if ( role != null ) { rolesCache.remove( role.getName() ); // if a role changes we need to invalidate the entire effective role set cache // since we have no concept of the heirarchy involved in the role sets effectiveRoleSetCache.clear(); } }
public Role getChildRole( RBACManager manager, Role role, String expectedChildRoleName, int childRoleCount ) throws RbacManagerException { assertTrue( role.hasChildRoles() ); List<String> childNames = role.getChildRoleNames(); assertNotNull( childNames ); assertEquals( 1, childNames.size() ); String childName = (String) childNames.get( 0 ); assertNotNull( childName ); Role childRole = manager.getRole( childName ); assertNotNull( childRole ); assertEquals( expectedChildRoleName, childRole.getName() ); return childRole; }