public interface RoleService extends RestService
Modifier and Type | Method and Description |
---|---|
ActionResponse |
addUserRole(String userId,
String roleId)
Adds a global role to a user
|
ActionResponse |
addUserRole(String tenantId,
String userId,
String roleId)
Adds a tenant based role to a user
|
Role |
create(String name)
Creates a new Role
|
ActionResponse |
delete(String roleId)
Delete a role by it's ID
|
Role |
get(String roleId)
Gets a role by ID
|
Role |
getByName(String name)
Gets a Role by Name
|
List<? extends Role> |
list()
Lists the global roles
|
List<? extends Role> |
listRolesForUser(String userId)
List roles for user.
|
List<? extends Role> |
listRolesForUser(String userId,
String tenantId)
List roles for user.
|
ActionResponse |
removeUserRole(String userId,
String roleId)
Removes a global role from a user
|
ActionResponse |
removeUserRole(String tenantId,
String userId,
String roleId)
Removes the user role from a user and the associated tenant
|
ActionResponse addUserRole(String userId, String roleId)
userId
- the user idroleId
- the role id to addActionResponse addUserRole(String tenantId, String userId, String roleId)
tenantId
- the tenant iduserId
- the user idroleId
- the role idActionResponse removeUserRole(String userId, String roleId)
userId
- the user idroleId
- the role idActionResponse removeUserRole(String tenantId, String userId, String roleId)
tenantId
- the tenant iduserId
- the user idroleId
- the role idList<? extends Role> listRolesForUser(String userId)
userId
- the user idList<? extends Role> listRolesForUser(String userId, String tenantId)
userId
- the user idtenantId
- the tenant idActionResponse delete(String roleId)
roleId
- the role idthe
- action responseRole getByName(String name)
name
- the name of the RoleCopyright © 2017. All rights reserved.