public interface RolesManager
All applications automatically inherit the following default roles:
Modifier and Type | Interface and Description |
---|---|
static class |
RolesManager.GrantedAuthorityDisplayComparator |
static class |
RolesManager.GrantedAuthorityNameComparator |
static class |
RolesManager.GrantedAuthorityNoCamparator |
static class |
RolesManager.SortRolesByType |
Modifier and Type | Field and Description |
---|---|
static GrantedAuthority |
USER
Any user with at least one role is, well, a USER.
|
Modifier and Type | Method and Description |
---|---|
void |
addGlobalRoleType(GrantedAuthority ga)
Creates a new global role available to all partners.
|
void |
addRoleType(java.lang.String roleName,
java.lang.String displayName)
Creates a new role for the current partner.
|
void |
addUserRole(XInfo userXinfo,
GrantedAuthority roleToAdd)
For the current partner, assign a role to a user.
|
int |
deleteRoleType(GrantedAuthority roleToDelete)
Deletes a role for the current partner.
|
java.util.Set<XInfo> |
getRoleHolders(GrantedAuthority role)
For the current partner, returns the set of users that hold a specified role.
|
java.util.Set<GrantedAuthority> |
getRoleTypes(RolesManager.SortRolesByType sortType,
GrantedAuthority.RoleScope scope)
Returns the set of roles for the current partner
|
java.util.Set<GrantedAuthority> |
getRoleTypes(java.lang.String partnerRef,
RolesManager.SortRolesByType sortType,
GrantedAuthority.RoleScope scope)
Returns the set of all roles for the specified partner.
|
java.util.Set<XInfo> |
getUnconnectedRoleHolders(GrantedAuthority role)
Returns the set of users, across all partners, that hold a specified role
|
java.util.Set<GrantedAuthority> |
getUserRoles(XInfo userXinfo,
RolesManager.SortRolesByType sortType)
For the current partner, returns the set of roles assigned to a user.
|
boolean |
hasRole(XInfo userXinfo,
GrantedAuthority role)
Returns whether a user holds a particular role.
|
void |
removeUserRole(XInfo userXinfo,
GrantedAuthority roleToRemove)
For the current partner, removes a role from a user.
|
static final GrantedAuthority USER
void addRoleType(java.lang.String roleName, java.lang.String displayName) throws AlreadyExistsException
roleName
- Role, by name, to adddisplayName
- Role's display nameAlreadyExistsException
- If the named role already existsvoid addGlobalRoleType(GrantedAuthority ga)
Note: For use only by Service Administrators.
For their application, partners call deleteRoleType(GrantedAuthority)
.
ga
- Role to addint deleteRoleType(GrantedAuthority roleToDelete) throws NotFoundException
roleToDelete
- Role to delete, by name.NotFoundException
- The specified role was not foundjava.util.Set<GrantedAuthority> getRoleTypes(java.lang.String partnerRef, RolesManager.SortRolesByType sortType, GrantedAuthority.RoleScope scope) throws NotFoundException
Note: For use only by Service Administrators.
For their application, partners call
#getRoleTypes(SortRolesByType, RoleScope)
partnerRef
- The partner's external referencesortType
- Specifies how to order the returned rolesscope
- Specifies which roles to return based on who defined themNotFoundException
- The specified partner or role was not foundjava.util.Set<GrantedAuthority> getRoleTypes(RolesManager.SortRolesByType sortType, GrantedAuthority.RoleScope scope)
sortType
- Specifies how to order the returned rolesscope
- Specifies which roles to return based on who defined themjava.util.Set<GrantedAuthority> getUserRoles(XInfo userXinfo, RolesManager.SortRolesByType sortType) throws NotFoundException
userXinfo
- A user's external identifier informationsortType
- How to sort the returned roles.NotFoundException
- If the user was not found.void addUserRole(XInfo userXinfo, GrantedAuthority roleToAdd) throws NotFoundException
Note: For use only by Service Administrators.
For their application, partners call removeUserRole(XInfo, GrantedAuthority)
.
userXinfo
- A user's external identifier informationroleToAdd
- The role to addNotFoundException
- If the user was not found.void removeUserRole(XInfo userXinfo, GrantedAuthority roleToRemove) throws NotFoundException
userXinfo
- A user's external identifier informationroleToRemove
- The role to removeNotFoundException
- When the userboolean hasRole(XInfo userXinfo, GrantedAuthority role) throws NotFoundException
userXinfo
- A user's external identifier informationrole
- Role to checkNotFoundException
- If the user was not found.java.util.Set<XInfo> getRoleHolders(GrantedAuthority role)
role
- Role to checkjava.util.Set<XInfo> getUnconnectedRoleHolders(GrantedAuthority role)
role
- Role to check