Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2014 Philip Helger (www.helger.com) philip[at]helger[dot]com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package com.helger.appbasics.security.role;
 
 import java.util.Map;
 
 
Interface for a role manager.

Author(s):
Philip Helger
 
 public interface IRoleManager
 {
  

Returns:
The role callback list. Never null.
 
   @Nonnull
   @ReturnsMutableObject (reason = "design")
Create a new role.

Parameters:
sName The name of the new role
Returns:
The created role and never null.
 
   @Nonnull
   IRole createNewRole (@Nonnull @Nonempty String sName);

  
Create a new role.

Parameters:
sName The name of the new role
aCustomAttrs A set of custom attributes. May be null.
Returns:
The created role and never null.
 
   @Nonnull
   IRole createNewRole (@Nonnull @Nonempty String sName, @Nullable Map <String, ?> aCustomAttrs);

  
Create a predefined role.

Parameters:
sID The ID of the new role
sName The name of the new role
Returns:
The created role and never null.
 
   @Nonnull
Delete the role with the passed ID

Parameters:
sRoleID The role ID to be deleted
Returns:
com.helger.commons.state.EChange.CHANGED if the passed role ID was found and deleted
 
   @Nonnull
   EChange deleteRole (@Nullable String sRoleID);

  
Check if the role with the specified ID is contained

Parameters:
sRoleID The role ID to be check
Returns:
true if such role exists, false otherwise
 
   boolean containsRoleWithID (@Nullable String sRoleID);

  
Check if all passed role IDs are contained

Parameters:
aRoleIDs The role IDs to be checked. May be null.
Returns:
true if the collection is empty or if all contained role IDs are contained
  boolean containsAllRolesWithID (@Nullable Collection <StringaRoleIDs);

  
Get the role with the specified ID

Parameters:
sRoleID The role ID to be resolved
Returns:
null if no such role exists.
  IRole getRoleOfID (@Nullable String sRoleID);

  

Returns:
A non-null collection of all available roles
  Collection <? extends IRolegetAllRoles ();

  
Rename the role with the passed ID

Parameters:
sRoleID The ID of the role to be renamed. May be null.
sNewName The new name of the role. May neither be null nor empty.
Returns:
com.helger.commons.state.EChange.CHANGED if the passed role ID was found, and the new name is different from the old name of he role
  EChange renameRole (@Nullable String sRoleID, @Nonnull @Nonempty String sNewName);

  
Change the modifiable data of a user group

Parameters:
sRoleID The ID of the role to be renamed. May be null.
sNewName The new name of the role. May neither be null nor empty.
aNewCustomAttrs Custom attributes. May be null.
Returns:
com.helger.commons.state.EChange
                       @Nonnull @Nonempty String sNewName,
                       @Nullable Map <String, ?> aNewCustomAttrs);
New to GrepCode? Check out our FAQ X