public final class MyMemoryRealm
extends org.restlet.security.Realm
Modifier and Type | Class and Description |
---|---|
private class |
MyMemoryRealm.DefaultEnroler
Enroler based on the default security model.
|
private class |
MyMemoryRealm.DefaultVerifier
Verifier based on the default security model.
|
Modifier and Type | Field and Description |
---|---|
private List<org.restlet.engine.security.RoleMapping> |
roleMappings
The modifiable list of role mappings.
|
private List<org.restlet.security.Group> |
rootGroups
The modifiable list of root groups.
|
private List<org.restlet.security.User> |
users
The modifiable list of users.
|
Constructor and Description |
---|
MyMemoryRealm()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
addGroups(org.restlet.security.User user,
Set<org.restlet.security.Group> userGroups,
org.restlet.security.Group currentGroup,
List<org.restlet.security.Group> stack,
boolean inheritOnly)
Recursively adds groups where a given user is a member.
|
Set<org.restlet.security.Group> |
findGroups(org.restlet.security.User user)
Finds the set of groups where a given user is a member.
|
Set<org.restlet.security.Group> |
findGroups(org.restlet.security.User user,
boolean inheritOnly)
Finds the set of groups where a given user is a member.
|
Set<org.restlet.security.Role> |
findRoles(org.restlet.Application application,
org.restlet.security.Group userGroup)
Finds the roles mapped to a given user group.
|
Set<org.restlet.security.Role> |
findRoles(org.restlet.Application application,
Set<org.restlet.security.Group> userGroups)
Finds the roles mapped to given user groups.
|
Set<org.restlet.security.Role> |
findRoles(org.restlet.Application application,
org.restlet.security.User user)
Finds the roles mapped to a given user, for a specific application.
|
Set<org.restlet.security.Role> |
findRoles(org.restlet.security.Group userGroup)
Finds the roles mapped to given user group.
|
Set<org.restlet.security.Role> |
findRoles(Set<org.restlet.security.Group> userGroups)
Finds the roles mapped to given user groups.
|
Set<org.restlet.security.Role> |
findRoles(org.restlet.security.User user)
Finds the roles mapped to a given user.
|
org.restlet.security.User |
findUser(String userIdentifier)
Finds a user in the organization based on its identifier.
|
private List<org.restlet.engine.security.RoleMapping> |
getRoleMappings()
Returns the modifiable list of role mappings.
|
List<org.restlet.security.Group> |
getRootGroups()
Returns the modifiable list of root groups.
|
List<org.restlet.security.User> |
getUsers()
Returns the modifiable list of users.
|
void |
map(org.restlet.security.Group group,
org.restlet.security.Role role)
Maps a group defined in a component to a role defined in the application.
|
void |
map(org.restlet.security.User user,
org.restlet.Application application,
String roleName)
Maps a user defined in a component to a role defined in the application.
|
void |
map(org.restlet.security.User user,
org.restlet.security.Role role)
Maps a user defined in a component to a role defined in the application.
|
void |
setRootGroups(List<org.restlet.security.Group> rootGroups)
Sets the modifiable list of root groups.
|
void |
setUsers(List<org.restlet.security.User> users)
Sets the modifiable list of users.
|
void |
unmap(org.restlet.security.Group group,
org.restlet.Application application,
String roleName)
Unmaps a group defined in a component from a role defined in the
application.
|
void |
unmap(org.restlet.security.Group group,
org.restlet.security.Role role)
Unmaps a group defined in a component from a role defined in the
application.
|
private void |
unmap(Object source,
org.restlet.security.Role role)
Unmaps an element (user, group or organization) defined in a component
from a role defined in the application.
|
void |
unmap(org.restlet.security.User user,
org.restlet.Application application,
String roleName)
Unmaps a user defined in a component from a role defined in the
application.
|
void |
unmap(org.restlet.security.User user,
org.restlet.security.Role role)
Unmaps a user defined in a component from a role defined in the
application.
|
private final List<org.restlet.engine.security.RoleMapping> roleMappings
private final List<org.restlet.security.Group> rootGroups
private final List<org.restlet.security.User> users
private void addGroups(org.restlet.security.User user, Set<org.restlet.security.Group> userGroups, org.restlet.security.Group currentGroup, List<org.restlet.security.Group> stack, boolean inheritOnly)
user
- The member user.userGroups
- The set of user groups to update.currentGroup
- The current group to inspect.stack
- The stack of ancestor groups.inheritOnly
- Indicates if only the ancestors groups that have their
"inheritRoles" property enabled should be added.public Set<org.restlet.security.Group> findGroups(org.restlet.security.User user)
user
- The member user.public Set<org.restlet.security.Group> findGroups(org.restlet.security.User user, boolean inheritOnly)
user
- The member user.inheritOnly
- Indicates if only the ancestors groups that have their
"inheritRoles" property enabled should be added.public Set<org.restlet.security.Role> findRoles(org.restlet.Application application, org.restlet.security.Group userGroup)
application
- The parent application. Can't be null.userGroup
- The user group.IllegalArgumentException
- If application is null.public Set<org.restlet.security.Role> findRoles(org.restlet.Application application, Set<org.restlet.security.Group> userGroups)
application
- The parent application. Can't be null.userGroups
- The user groups.IllegalArgumentException
- If application is null.public Set<org.restlet.security.Role> findRoles(org.restlet.Application application, org.restlet.security.User user)
application
- The parent application. Can't be null.user
- The user.IllegalArgumentException
- If application is null.public Set<org.restlet.security.Role> findRoles(org.restlet.security.Group userGroup)
userGroup
- The user group.public Set<org.restlet.security.Role> findRoles(Set<org.restlet.security.Group> userGroups)
userGroups
- The user groups.public Set<org.restlet.security.Role> findRoles(org.restlet.security.User user)
user
- The user.public org.restlet.security.User findUser(String userIdentifier)
userIdentifier
- The identifier to match.private List<org.restlet.engine.security.RoleMapping> getRoleMappings()
public List<org.restlet.security.Group> getRootGroups()
public List<org.restlet.security.User> getUsers()
public void map(org.restlet.security.Group group, org.restlet.security.Role role)
group
- The source group.role
- The target role.public void map(org.restlet.security.User user, org.restlet.Application application, String roleName)
user
- The source user.application
- The parent application. Can't be null.roleName
- he target role name.IllegalArgumentException
- If application is null.public void map(org.restlet.security.User user, org.restlet.security.Role role)
user
- The source user.role
- The target role.public void setRootGroups(List<org.restlet.security.Group> rootGroups)
rootGroups
- A list of root groups.public void setUsers(List<org.restlet.security.User> users)
users
- A list of users.public void unmap(org.restlet.security.Group group, org.restlet.Application application, String roleName)
group
- The source group.application
- The parent application. Can't be null.roleName
- The target role name.IllegalArgumentException
- If application is null.public void unmap(org.restlet.security.Group group, org.restlet.security.Role role)
group
- The source group.role
- The target role.private void unmap(Object source, org.restlet.security.Role role)
source
- The source group.role
- The target role.public void unmap(org.restlet.security.User user, org.restlet.Application application, String roleName)
user
- The source user.application
- The parent application. Can't be null.roleName
- The target role name.IllegalArgumentException
- If application is null.public void unmap(org.restlet.security.User user, org.restlet.security.Role role)
user
- The source user.role
- The target role.Copyright © 2017–2020 CNES. All rights reserved.