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 Details

    • logger

      private static final org.apache.commons.logging.Log logger
    • EXTERNAL_USER_GROUP

      private static final String 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

      private List<CommentPermissionPlugin> plugins
  • Constructor Details

    • CommentPermissionServiceImpl

      public CommentPermissionServiceImpl()
  • Method Details

    • setPlugins

      @Autowired(required=false) public void setPlugins(List<CommentPermissionPlugin> plugins)

      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:
      canModify in interface CommentPermissionService
      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)