Package org.restlet.security
Class MemoryRealm
java.lang.Object
org.restlet.security.Realm
org.restlet.security.MemoryRealm
Security realm based on a memory model. The model is composed of root groups,
users and mapping to associated roles.
- Author:
- Jerome Louvel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindGroups(User user) Finds the set of groups where a given user is a member.findGroups(User user, boolean inheritOnly) Finds the set of groups where a given user is a member.Finds the roles mapped to given user groups.findRoles(Application application, Set<Group> userGroups) Finds the roles mapped to given user groups.findRoles(Application application, Group userGroup) Finds the roles mapped to a given user group.findRoles(Application application, User user) Finds the roles mapped to a given user, for a specific application.Finds the roles mapped to given user group.Finds the roles mapped to a given user.Finds a user in the organization based on its identifier.Returns the modifiable list of root groups.getUsers()Returns the modifiable list of users.voidMaps a group defined in a component to a role defined in the application.voidmap(User user, Application application, String roleName) Maps a user defined in a component to a role defined in the application.voidMaps a user defined in a component to a role defined in the application.voidsetRootGroups(List<Group> rootGroups) Sets the modifiable list of root groups.voidSets the modifiable list of users.voidunmap(Group group, Application application, String roleName) Unmaps a group defined in a component from a role defined in the application.voidUnmaps a group defined in a component from a role defined in the application.voidunmap(User user, Application application, String roleName) Unmaps a user defined in a component from a role defined in the application.voidUnmaps a user defined in a component from a role defined in the application.Methods inherited from class org.restlet.security.Realm
getEnroler, getName, getParameters, getVerifier, isStarted, isStopped, setEnroler, setName, setParameters, setVerifier, start, stop, toString
-
Constructor Details
-
MemoryRealm
public MemoryRealm()Constructor.
-
-
Method Details
-
findGroups
Finds the set of groups where a given user is a member. Note that inheritable ancestors groups are also returned.- Parameters:
user- The member user.- Returns:
- The set of groups.
-
findGroups
Finds the set of groups where a given user is a member.- Parameters:
user- The member user.inheritOnly- Indicates if only the ancestors groups that have their "inheritRoles" property enabled should be added.- Returns:
- The set of groups.
-
findRoles
Finds the roles mapped to a given user group.- Parameters:
application- The parent application. Can't be null.userGroup- The user group.- Returns:
- The roles found.
- Throws:
IllegalArgumentException- If application is null.
-
findRoles
Finds the roles mapped to given user groups.- Parameters:
application- The parent application. Can't be null.userGroups- The user groups.- Returns:
- The roles found.
- Throws:
IllegalArgumentException- If application is null.
-
findRoles
Finds the roles mapped to a given user, for a specific application.- Parameters:
application- The parent application. Can't be null.user- The user.- Returns:
- The roles found.
- Throws:
IllegalArgumentException- If application is null.
-
findRoles
Finds the roles mapped to given user group.- Parameters:
userGroup- The user group.- Returns:
- The roles found.
-
findRoles
Finds the roles mapped to given user groups.- Parameters:
userGroups- The user groups.- Returns:
- The roles found.
-
findRoles
Finds the roles mapped to a given user.- Parameters:
user- The user.- Returns:
- The roles found.
-
findUser
Finds a user in the organization based on its identifier.- Parameters:
userIdentifier- The identifier to match.- Returns:
- The matched user or null.
-
getRootGroups
Returns the modifiable list of root groups.- Returns:
- The modifiable list of root groups.
-
getUsers
Returns the modifiable list of users.- Returns:
- The modifiable list of users.
-
map
Maps a group defined in a component to a role defined in the application.- Parameters:
group- The source group.role- The target role.
-
map
Maps a user defined in a component to a role defined in the application.- Parameters:
user- The source user.application- The parent application. Can't be null.roleName- The target role name.- Throws:
IllegalArgumentException- If application is null.
-
map
Maps a user defined in a component to a role defined in the application.- Parameters:
user- The source user.role- The target role.
-
setRootGroups
Sets the modifiable list of root groups. This method clears the current list and adds all entries in the parameter list.- Parameters:
rootGroups- A list of root groups.
-
setUsers
Sets the modifiable list of users. This method clears the current list and adds all entries in the parameter list.- Parameters:
users- A list of users.
-
unmap
Unmaps a group defined in a component from a role defined in the application.- Parameters:
group- The source group.application- The parent application. Can't be null.roleName- The target role name.- Throws:
IllegalArgumentException- If application is null.
-
unmap
Unmaps a group defined in a component from a role defined in the application.- Parameters:
group- The source group.role- The target role.
-
unmap
Unmaps a user defined in a component from a role defined in the application.- Parameters:
user- The source user.application- The parent application. Can't be null.roleName- The target role name.- Throws:
IllegalArgumentException- If application is null.
-
unmap
Unmaps a user defined in a component from a role defined in the application.- Parameters:
user- The source user.role- The target role.
-