public Privilege addPrivilege( Privilege privilege ) throws InvalidConfigurationException { this.throwException(); return null; }
@Override public void checkPermissions( PrincipalCollection subjectPrincipal, String... permissions ) throws AuthorizationException { for ( String permission : permissions ) { checkPermission( subjectPrincipal, permission ); } }
@Override public boolean isPermittedAll( PrincipalCollection subjectPrincipal, String... permissions ) { for ( String permission : permissions ) { if ( !isPermitted( subjectPrincipal, permission ) ) { return false; } } return true; }
public Role getRole(String roleId) throws NoSuchRoleException { for (Role role : this.listRoles()) { if (role.getRoleId().equals(roleId)) { return role; } } throw new NoSuchRoleException("Role '" + roleId + "' not found."); }
protected RoleAndPrivilegeListResource toDTO( Role role ) { RoleAndPrivilegeListResource resource = new RoleAndPrivilegeListResource(); resource.setId( role.getRoleId() ); resource.setName( role.getName() ); resource.setDescription( role.getDescription() ); resource.setType( "role" ); return resource; }
protected PlexusRoleResource securityToRestModel(Role role) { if (role == null) { return null; } PlexusRoleResource roleResource = new PlexusRoleResource(); roleResource.setRoleId(role.getRoleId()); roleResource.setName(role.getName()); roleResource.setSource(role.getSource()); return roleResource; }
protected Permission delegateCreate( final String permission ) { return delegate.create( permission ); } }
@Override public boolean hasAllRoles( PrincipalCollection subjectPrincipal, Collection<String> roleIdentifiers ) { for ( String roleIdentifier : roleIdentifiers ) { if ( !hasRole( subjectPrincipal, roleIdentifier ) ) { return false; } } return true; }
@Override public Permission create( final String permission ) { return getOrCreate( permission ); }
public AuthorizationManager getAuthorizationManager( String source ) throws NoSuchAuthorizationManagerException { if ( !this.authorizationManagers.containsKey( source ) ) { throw new NoSuchAuthorizationManagerException( "AuthorizationManager with source: '" + source + "' could not be found." ); } return this.authorizationManagers.get( source ); }
public Role getRole( String roleId ) throws NoSuchRoleException { for ( Role role : this.listRoles() ) { if ( role.getRoleId().equals( roleId ) ) { return role; } } throw new NoSuchRoleException( "Role '" + roleId + "' not found." ); }
protected RoleAndPrivilegeListResource toDTO(Role role) { RoleAndPrivilegeListResource resource = new RoleAndPrivilegeListResource(); resource.setId(role.getRoleId()); resource.setName(role.getName()); resource.setDescription(role.getDescription()); resource.setType("role"); return resource; }
public Role addRole( Role role ) throws InvalidConfigurationException { this.throwException(); return null; }
@Override public void checkPermissions( PrincipalCollection subjectPrincipal, Collection<Permission> permissions ) throws AuthorizationException { for ( Permission permission : permissions ) { checkPermission( subjectPrincipal, permission ); } }
@Override public boolean isPermittedAll( PrincipalCollection subjectPrincipal, Collection<Permission> permissions ) { for ( Permission permission : permissions ) { if ( !isPermitted( subjectPrincipal, permission ) ) { return false; } } return true; }
@Override public void checkRole( PrincipalCollection subjectPrincipal, String roleIdentifier ) throws AuthorizationException { if ( !this.hasRole( subjectPrincipal, roleIdentifier ) ) { throw new AuthorizationException( "User is not permitted role: " + roleIdentifier ); } }
public void deletePrivilege( String privilegeId ) throws NoSuchPrivilegeException { this.throwException(); }
public void deleteRole( String roleId ) throws NoSuchRoleException { this.throwException(); }
public Privilege updatePrivilege( Privilege privilege ) throws NoSuchPrivilegeException, InvalidConfigurationException { this.throwException(); return null; }
public Role updateRole( Role role ) throws NoSuchRoleException, InvalidConfigurationException { this.throwException(); return null; }