public boolean roleExists( String name ) throws RbacManagerException { if ( rolesCache.hasKey( name ) ) { return true; } return this.rbacImpl.roleExists( name ); }
public boolean roleExists( Role role ) throws RbacManagerException { if ( rolesCache.hasKey( role.getName() ) ) { return true; } return this.rbacImpl.roleExists( role ); }
if ( !rbacManager.roleExists( roleName ) )
if ( !rbacManager.roleExists( roleName ) )
boolean exists = rbacManager.roleExists( name ); if ( exists )
boolean exists = rbacManager.roleExists( name ); if ( exists )
public boolean templatedRoleExists( String templateId, String resource ) throws RoleManagerException { ModelTemplate modelTemplate = RoleModelUtils.getModelTemplate( blessedModel, templateId ); // template not existing is valid to check, it will throw exception on trying to create if ( modelTemplate == null ) { return false; } else { try { if ( rbacManager.roleExists( modelTemplate.getNamePrefix() + modelTemplate.getDelimiter() + resource ) ) { return true; } else { return false; } } catch ( RbacManagerException e ) { throw new RoleManagerException( e.getMessage(), e ); } } }
public boolean roleExists( String roleId ) throws RoleManagerException { ModelRole modelRole = RoleModelUtils.getModelRole( blessedModel, roleId ); if ( modelRole == null ) { return false; } else { try { if ( rbacManager.roleExists( modelRole.getName() ) ) { return true; } else { // perhaps try and reload the model here? throw new RoleManagerException( "breakdown in role management, role '" + modelRole.getName() + "' exists in configuration but was not created in underlying store" ); } } catch ( RbacManagerException e ) { throw new RoleManagerException( e.getMessage(), e ); } } }
public void unassignRoleByName( String roleName, String principal ) throws RoleManagerException { try { UserAssignment userAssignment; if ( rbacManager.userAssignmentExists( principal ) ) { userAssignment = rbacManager.getUserAssignment( principal ); } else { throw new RoleManagerException( "UserAssignment for principal " + principal + "does not exist, can't unassign role." ); } if ( !rbacManager.roleExists( roleName ) ) { throw new RoleManagerException( "Unable to unassign role: " + roleName + " does not exist." ); } userAssignment.removeRoleName( roleName ); rbacManager.saveUserAssignment( userAssignment ); } catch ( RbacManagerException e ) { throw new RoleManagerException( "Unable to unassign role: unable to manage user assignment", e ); } }
public void assignRoleByName( String roleName, String principal ) throws RoleManagerException { try { UserAssignment userAssignment; if ( rbacManager.userAssignmentExists( principal ) ) { userAssignment = rbacManager.getUserAssignment( principal ); } else { userAssignment = rbacManager.createUserAssignment( principal ); } if ( !rbacManager.roleExists( roleName ) ) { throw new RoleManagerException( "Unable to assign role: " + roleName + " does not exist." ); } userAssignment.addRoleName( roleName ); rbacManager.saveUserAssignment( userAssignment ); } catch ( RbacManagerException e ) { throw new RoleManagerException( "Unable to assign role: unable to manage user assignment", e ); } }
roleExists = rbacManager.roleExists( templateName ); if ( rbacManager.roleExists( childRoleName ) ) if ( !rbacManager.roleExists( role.getName() ) ) if ( rbacManager.roleExists( parentRoleName ) )
if ( !manager.roleExists( "User Administrator" ) ) if ( !manager.roleExists( "System Administrator" ) ) if ( !manager.roleExists( "Trusted Developer" ) ) if ( !manager.roleExists( "Developer" ) )