public final class RoleResourceHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
assignOrRemoveRoleForEntity(Long blogId,
BlogRole role,
Long entityId)
Remove or assign role for entity
|
static void |
assignOrRemoveRoleForGroup(String groupAlias,
Long blogId,
BlogRole role)
Assign or remove role for a group
|
static void |
assignOrRemoveRoleForUser(String userAlias,
Long blogId,
BlogRole role)
Assign or remove role for a user
|
static void |
assignRoleResources(RoleResource[] roleResources,
Long topicId)
Assign role resources.
|
static BlogRole |
getBlogRole(ERole eRole)
Get topic role
|
public static void assignOrRemoveRoleForEntity(Long blogId, BlogRole role, Long entityId) throws NoBlogManagerLeftException, BlogNotFoundException, BlogAccessException, CommunoteEntityNotFoundException
blogId - identifier of a blogrole - role of the blogentityId - identifier of an entity (user/group)NoBlogManagerLeftException - no active user with managment rightsBlogNotFoundException - blog not foundBlogAccessException - can not access blogCommunoteEntityNotFoundException - can not found entity (user/group)public static void assignOrRemoveRoleForGroup(String groupAlias, Long blogId, BlogRole role) throws NoBlogManagerLeftException, BlogNotFoundException, BlogAccessException, CommunoteEntityNotFoundException
groupAlias - alias of groupblogId - identifier of the blogrole - role of the blogNoBlogManagerLeftException - no active user with managment rightsBlogNotFoundException - blog not foundBlogAccessException - can not access blogCommunoteEntityNotFoundException - can not found entity (user/group)public static void assignOrRemoveRoleForUser(String userAlias, Long blogId, BlogRole role) throws NoBlogManagerLeftException, BlogNotFoundException, BlogAccessException, CommunoteEntityNotFoundException
userAlias - alias of userblogId - identifier of the blogrole - role of the blogNoBlogManagerLeftException - no active user with managment rightsBlogNotFoundException - blog not foundBlogAccessException - can not access blogCommunoteEntityNotFoundException - can not found entity (user/group)public static void assignRoleResources(RoleResource[] roleResources, Long topicId) throws BlogNotFoundException, BlogAccessException, CommunoteEntityNotFoundException, NoBlogManagerLeftException
roleResources - the external object resources.topicId - the identifier of the topic.NoBlogManagerLeftException - cannot add role because no topic manager exists after create of topicCommunoteEntityNotFoundException - can not found entity (user or group)BlogAccessException - can not access topicBlogNotFoundException - can not found topicCopyright © 2019 Communote team. All rights reserved.