Package fr.becpg.repo.comment.impl
Class CommentPermissionServiceImpl
java.lang.Object
fr.becpg.repo.comment.impl.CommentPermissionServiceImpl
- All Implemented Interfaces:
CommentPermissionService
@Service("commentPermissionService")
public class CommentPermissionServiceImpl
extends Object
implements CommentPermissionService
Refuses an external user the comments of other users, then applies every
CommentPermissionPlugin
governing the commented node. Otherwise comments keep the standard Alfresco behaviour.- Author:
- valentin
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.alfresco.service.cmr.security.AuthorityServiceprivate org.alfresco.repo.forum.CommentServiceprivate static final Stringprivate static final org.apache.commons.logging.Logprivate org.alfresco.service.cmr.repository.NodeServiceprivate List<CommentPermissionPlugin> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanModify(org.alfresco.service.cmr.repository.NodeRef commentNodeRef) Tells whether the current user can edit and delete a comment.private booleanisExternalUserAndNotCreator(org.alfresco.service.cmr.repository.NodeRef commentNodeRef) voidsetPlugins(List<CommentPermissionPlugin> plugins) Setter for the fieldplugins.
-
Field Details
-
logger
private static final org.apache.commons.logging.Log logger -
EXTERNAL_USER_GROUP
-
commentService
@Autowired private org.alfresco.repo.forum.CommentService commentService -
nodeService
@Autowired private org.alfresco.service.cmr.repository.NodeService nodeService -
authorityService
@Autowired private org.alfresco.service.cmr.security.AuthorityService authorityService -
plugins
-
-
Constructor Details
-
CommentPermissionServiceImpl
public CommentPermissionServiceImpl()
-
-
Method Details
-
setPlugins
Setter for the field
plugins.- Parameters:
plugins- the registered comment permission plugins
-
canModify
public boolean canModify(org.alfresco.service.cmr.repository.NodeRef commentNodeRef) Tells whether the current user can edit and delete a comment.- Specified by:
canModifyin interfaceCommentPermissionService- Parameters:
commentNodeRef- the comment- Returns:
- false if the current user is an external user who did not post the comment, or if a plugin governing the commented node refuses it, true otherwise
-
isExternalUserAndNotCreator
private boolean isExternalUserAndNotCreator(org.alfresco.service.cmr.repository.NodeRef commentNodeRef)
-