@Service(value="blogRightsManagement") public class BlogRightsManagementImpl extends BlogRightsManagementBase
BlogRightsManagement
Constructor and Description |
---|
BlogRightsManagementImpl() |
addEntity, addEntityForExternal, addEntityForExternalTrusted, assignEntity, assignEntity, assignEntityForExternal, assignEntityForExternalTrusted, assignManagementAccessToCurrentUser, changePublicAccess, changeRoleOfMemberByEntityId, changeRoleOfMemberByEntityIdForExternal, currentUserHasManagementAccess, currentUserHasReadAccess, currentUserHasWriteAccess, getAndCheckBlogAccess, getPrincipal, getRoleOfCurrentUser, getRoleOfEntity, getRoleOfUser, hasAnotherManager, hasAnotherReader, isEntityDirectMember, removeMemberByEntityId, removeMemberByEntityIdForExternal, removeUserFromAllBlogs, setAllCanReadAllCanWrite, userHasManagementAccess, userHasReadAccess, userHasWriteAccess
@Transactional(readOnly=true) public <T> Collection<T> getMappedUsers(Long topicId, CollectionConverter<UserToBlogRoleMapping,T> converter, BlogRole... roles)
topicId
- Id of the topic the users are requested.converter
- An Converter for converting the found users to something else.roles
- The user must have at least one of these roles.protected void handleAddEntity(Long blogId, Long entityId, BlogRole role) throws BlogNotFoundException, CommunoteEntityNotFoundException, BlogAccessException
BlogRightsManagementBase.addEntity(Long, Long, BlogRole)
handleAddEntity
in class BlogRightsManagementBase
BlogNotFoundException
CommunoteEntityNotFoundException
BlogAccessException
protected void handleAddEntityForExternal(Long blogId, Long entityId, BlogRole role, String externalSystemId, String externalId) throws BlogNotFoundException, CommunoteEntityNotFoundException, ExternalObjectNotAssignedException, BlogAccessException
BlogRightsManagementBase.addEntityForExternal(Long, Long, BlogRole, String
externalSystemId, String externalId )
handleAddEntityForExternal
in class BlogRightsManagementBase
blogId
- ID of the blogentityId
- ID of a user or a grouprole
- the role describing the access right the entity should getexternalSystemId
- identifier of the external systemexternalId
- identifier of the external object within the external systemBlogNotFoundException
- in case the blog does not existCommunoteEntityNotFoundException
- in case the user or group does not existExternalObjectNotAssignedException
- in case the external object is not assigned to the blogBlogAccessException
- in case the current user is not manager of the blogprotected void handleAddEntityForExternalTrusted(Long blogId, Long entityId, BlogRole role, String externalSystemId) throws BlogNotFoundException, CommunoteEntityNotFoundException, BlogAccessException
BlogRightsManagementBase.addEntityForExternalTrusted(Long, Long, BlogRole, String)
handleAddEntityForExternalTrusted
in class BlogRightsManagementBase
blogId
- ID of the blogentityId
- ID of a user or a grouprole
- the role describing the access right the entity should getexternalSystemId
- identifier of the external systemBlogNotFoundException
- in case the blog does not existCommunoteEntityNotFoundException
- in case the user or group does not existBlogAccessException
- in case the current user is not allowed to add the entityprotected void handleAssignEntity(Long blogId, Long entityId, BlogRole role) throws BlogAccessException, BlogNotFoundException, CommunoteEntityNotFoundException, NoBlogManagerLeftException
BlogRightsManagementBase.assignEntity(Long, Long, BlogRole)
handleAssignEntity
in class BlogRightsManagementBase
BlogAccessException
BlogNotFoundException
CommunoteEntityNotFoundException
NoBlogManagerLeftException
protected void handleAssignEntity(Long blogId, Long entityId, BlogRole role, boolean createNote) throws BlogAccessException, BlogNotFoundException, CommunoteEntityNotFoundException, NoBlogManagerLeftException
BlogRightsManagementBase.assignEntity(Long, Long, BlogRole, boolean)
handleAssignEntity
in class BlogRightsManagementBase
BlogAccessException
BlogNotFoundException
CommunoteEntityNotFoundException
NoBlogManagerLeftException
protected void handleAssignEntityForExternal(Long blogId, Long entityId, BlogRole role, String externalSystemId, String externalId) throws BlogNotFoundException, CommunoteEntityNotFoundException, ExternalObjectNotAssignedException, BlogAccessException
handleAssignEntityForExternal
in class BlogRightsManagementBase
blogId
- identifier of topicentityId
- user or group identifierrole
- of externalexternalSystemId
- identifier of external systemexternalId
- identifier of external object in external systemBlogNotFoundException
- can not found topicCommunoteEntityNotFoundException
- can not found user BlogAccessExceptionExternalObjectNotAssignedException
- external object is not assigned to topicBlogAccessException
- can not access topicprotected void handleAssignEntityForExternalTrusted(Long blogId, Long entityId, BlogRole role, String externalSystemId) throws BlogAccessException, BlogNotFoundException, CommunoteEntityNotFoundException
handleAssignEntityForExternalTrusted
in class BlogRightsManagementBase
BlogAccessException
BlogNotFoundException
CommunoteEntityNotFoundException
protected void handleAssignManagementAccessToCurrentUser(Long blogId) throws AuthorizationException, BlogNotFoundException
BlogRightsManagementBase.assignManagementAccessToCurrentUser(Long)
handleAssignManagementAccessToCurrentUser
in class BlogRightsManagementBase
AuthorizationException
BlogNotFoundException
protected void handleChangePublicAccess(Long topicId, boolean allowPublicAccess) throws BlogNotFoundException, BlogAccessException
BlogRightsManagementBase.changePublicAccess(Long, boolean)
handleChangePublicAccess
in class BlogRightsManagementBase
BlogAccessException
BlogNotFoundException
protected void handleChangeRoleOfMemberByEntityId(Long blogId, Long entityId, BlogRole role) throws BlogNotFoundException, BlogMemberNotFoundException, NoBlogManagerLeftException, BlogAccessException
BlogRightsManagementBase
BlogRightsManagementBase.changeRoleOfMemberByEntityId(Long, Long, BlogRole)
protected void handleChangeRoleOfMemberByEntityIdForExternal(Long blogId, Long entityId, BlogRole role, String externalSystemId) throws BlogNotFoundException, BlogMemberNotFoundException, BlogAccessException
BlogRightsManagementBase
BlogRightsManagementBase.changeRoleOfMemberByEntityIdForExternal(Long, Long, BlogRole, String)
handleChangeRoleOfMemberByEntityIdForExternal
in class BlogRightsManagementBase
BlogNotFoundException
BlogMemberNotFoundException
BlogAccessException
protected boolean handleCurrentUserHasManagementAccess(Long blogId)
BlogRightsManagementBase.currentUserHasManagementAccess(Long)
handleCurrentUserHasManagementAccess
in class BlogRightsManagementBase
protected boolean handleCurrentUserHasReadAccess(Long blogId, boolean ignoreAllCanFlags)
BlogRightsManagementBase.currentUserHasReadAccess(Long, boolean)
handleCurrentUserHasReadAccess
in class BlogRightsManagementBase
protected boolean handleCurrentUserHasWriteAccess(Long blogId, boolean ignoreAllCanFlags)
BlogRightsManagementBase.currentUserHasWriteAccess(Long, boolean)
handleCurrentUserHasWriteAccess
in class BlogRightsManagementBase
protected Blog handleGetAndCheckBlogAccess(Long blogId, BlogRole blogRole) throws BlogAccessException, BlogNotFoundException
BlogRightsManagementBase.getAndCheckBlogAccess(Long, BlogRole)
handleGetAndCheckBlogAccess
in class BlogRightsManagementBase
BlogAccessException
BlogNotFoundException
protected BlogRole handleGetRoleOfCurrentUser(Long blogId, boolean ignoreAllCanFlags)
BlogRightsManagementBase.getRoleOfCurrentUser(Long, boolean)
handleGetRoleOfCurrentUser
in class BlogRightsManagementBase
protected BlogRole handleGetRoleOfEntity(Long blogId, Long entityId, boolean ignoreAllCanFlags)
BlogRightsManagementBase.getRoleOfEntity(Long, Long, boolean)
handleGetRoleOfEntity
in class BlogRightsManagementBase
protected BlogRole handleGetRoleOfUser(Long blogId, Long userId, boolean ignoreAllCanFlags)
BlogRightsManagementBase.getRoleOfUser(Long, Long, boolean)
handleGetRoleOfUser
in class BlogRightsManagementBase
protected boolean handleHasAnotherManager(Long blogId, Long userId)
BlogRightsManagementBase.hasAnotherManager(Long, Long)
handleHasAnotherManager
in class BlogRightsManagementBase
protected boolean handleHasAnotherReader(Long blogId, Long userId)
BlogRightsManagementBase.hasAnotherReader(Long, Long)
handleHasAnotherReader
in class BlogRightsManagementBase
protected boolean handleIsEntityDirectMember(Long blogId, Long entityId)
BlogRightsManagementBase.isEntityDirectMember(Long, Long)
handleIsEntityDirectMember
in class BlogRightsManagementBase
protected void handleRemoveMemberByEntityId(Long topicId, Long entityId) throws BlogAccessException, NoBlogManagerLeftException, BlogNotFoundException
BlogRightsManagementBase.removeMemberByEntityId(Long, Long)
handleRemoveMemberByEntityId
in class BlogRightsManagementBase
BlogAccessException
NoBlogManagerLeftException
BlogNotFoundException
protected void handleRemoveMemberByEntityIdForExternal(Long blogId, Long entityId, String externalSystemId) throws BlogNotFoundException, BlogAccessException
BlogRightsManagementBase.removeMemberByEntityIdForExternal(Long, Long, String)
handleRemoveMemberByEntityIdForExternal
in class BlogRightsManagementBase
BlogAccessException
BlogNotFoundException
protected void handleRemoveUserFromAllBlogs(Long userId, Collection<Long> blogsToNotCheckForLastManager) throws AuthorizationException, NoBlogManagerLeftException
#removeUserFromAllBlogs(Long, java.util.Collection)
handleRemoveUserFromAllBlogs
in class BlogRightsManagementBase
AuthorizationException
NoBlogManagerLeftException
protected Blog handleSetAllCanReadAllCanWrite(Long blogId, boolean allCanRead, boolean allCanWrite) throws BlogNotFoundException, BlogAccessException
BlogRightsManagementBase.setAllCanReadAllCanWrite(Long, boolean, boolean)
handleSetAllCanReadAllCanWrite
in class BlogRightsManagementBase
BlogNotFoundException
BlogAccessException
protected boolean handleUserHasManagementAccess(Long blogId, Long userId)
BlogRightsManagementBase.userHasManagementAccess(Long, Long)
handleUserHasManagementAccess
in class BlogRightsManagementBase
protected boolean handleUserHasReadAccess(Long blogId, Long userId, boolean ignoreAllCanFlags)
BlogRightsManagementBase.userHasReadAccess(Long, Long, boolean)
handleUserHasReadAccess
in class BlogRightsManagementBase
protected boolean handleUserHasWriteAccess(Long blogId, Long userId, boolean ignoreAllCanFlags)
BlogRightsManagementBase.userHasWriteAccess(Long, Long, boolean)
handleUserHasWriteAccess
in class BlogRightsManagementBase
@PostConstruct public void init()
Copyright © 2019 Communote team. All rights reserved.