public void saveRoles( Collection<Role> roles ) throws RbacObjectInvalidException, RbacManagerException { if ( roles == null ) { // Nothing to do. return; } for ( Role role : roles ) { saveRole( role ); } }
public Role getRole( String roleName ) throws RbacObjectNotFoundException { triggerInit(); assertRoleExists( roleName ); return roles.get( roleName ); }
public Resource getResource( String resourceIdentifier ) throws RbacObjectNotFoundException, RbacManagerException { triggerInit(); assertResourceExists( resourceIdentifier ); return resources.get( resourceIdentifier ); }
public UserAssignment createUserAssignment( String principal ) throws RbacManagerException { try { return getUserAssignment( principal ); } catch ( RbacObjectNotFoundException e ) { UserAssignment ua = new MemoryUserAssignment(); ua.setPrincipal( principal ); fireRbacUserAssignmentSaved( ua ); return ua; } }
public UserAssignment getUserAssignment( String principal ) throws RbacObjectNotFoundException, RbacManagerException { triggerInit(); assertUserAssignmentExists( principal ); return userAssignments.get( principal ); }
public Operation getOperation( String operationName ) throws RbacObjectNotFoundException, RbacManagerException { triggerInit(); assertOpertionExists( operationName ); return operations.get( operationName ); }
public Permission getPermission( String permissionName ) throws RbacObjectNotFoundException, RbacManagerException { triggerInit(); assertPermissionExists( permissionName ); return permissions.get( permissionName ); }
public Operation createOperation( String name ) throws RbacManagerException { Operation operation; try { operation = getOperation( name ); } catch ( RbacObjectNotFoundException e ) { operation = new MemoryOperation(); operation.setName( name ); } return operation; }
public Resource createResource( String identifier ) throws RbacManagerException { Resource resource; try { resource = getResource( identifier ); } catch ( RbacObjectNotFoundException e ) { resource = new MemoryResource(); resource.setIdentifier( identifier ); } return resource; }
public Permission createPermission( String name ) throws RbacManagerException { Permission permission; try { permission = getPermission( name ); } catch ( RbacObjectNotFoundException e ) { permission = new MemoryPermission(); permission.setName( name ); } return permission; }
/** * Method equals * * @param other */ public boolean equals( Object other ) { if ( this == other ) { return true; } if ( !( other instanceof MemoryOperation ) ) { return false; } MemoryOperation that = (MemoryOperation) other; boolean result = true; result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) ); return result; }
/** * Method equals * * @param other */ public boolean equals( Object other ) { if ( this == other ) { return true; } if ( !( other instanceof MemoryResource ) ) { return false; } MemoryResource that = (MemoryResource) other; boolean result = true; result = result && ( getIdentifier() == null ? that.getIdentifier() == null : getIdentifier().equals( that.getIdentifier() ) ); return result; }
/** * Method equals * * @param other */ public boolean equals( Object other ) { if ( this == other ) { return true; } if ( !( other instanceof MemoryPermission ) ) { return false; } MemoryPermission that = (MemoryPermission) other; boolean result = true; result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) ); return result; }
public void triggerInit() { if ( !hasTriggeredInit ) { fireRbacInit( roles.isEmpty() ); hasTriggeredInit = true; } }
/** * Method toString */ public java.lang.String toString() { StringBuilder buf = new StringBuilder(); buf.append( "name = '" ); buf.append( getName() + "'" ); return buf.toString(); }
/** * Method toString */ public java.lang.String toString() { StringBuilder buf = new StringBuilder(); buf.append( "principal = '" ); buf.append( getPrincipal() + "'" ); return buf.toString(); }
public Role createRole( String name ) { Role role = new MemoryRole(); role.setName( name ); return role; }
/** * Method toString */ public String toString() { StringBuilder buf = new StringBuilder(); buf.append( "name = '" ); buf.append( getName() + "'" ); return buf.toString(); }
/** * Method toString */ public String toString() { StringBuilder buf = new StringBuilder(); buf.append( "identifier = '" ).append( getIdentifier() + "'" ); return buf.toString(); }
/** * Method toString */ public String toString() { StringBuilder buf = new StringBuilder(); buf.append( "name = '" ); buf.append( getName() + "'" ); return buf.toString(); }