Class RMCaveatConfigComponentImpl

  • All Implemented Interfaces:
    RMCaveatConfigComponent, org.alfresco.repo.content.ContentServicePolicies.OnContentUpdatePolicy, org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy, org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy, org.alfresco.repo.policy.ClassPolicy, org.alfresco.repo.policy.Policy

    public class RMCaveatConfigComponentImpl
    extends Object
    implements org.alfresco.repo.content.ContentServicePolicies.OnContentUpdatePolicy, org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy, org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy, RMCaveatConfigComponent
    RM Caveat Config component impl
    Author:
    janv
    • Constructor Detail

      • RMCaveatConfigComponentImpl

        public RMCaveatConfigComponentImpl()
    • Method Detail

      • setCaveatConfig

        public void setCaveatConfig​(org.alfresco.repo.cache.SimpleCache<String,​Map<String,​List<String>>> caveatConfig)
      • setNodeService

        public void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)
      • setContentService

        public void setContentService​(org.alfresco.service.cmr.repository.ContentService contentService)
      • setDictionaryService

        public void setDictionaryService​(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
      • setNamespaceService

        public void setNamespaceService​(org.alfresco.service.namespace.NamespaceService namespaceService)
      • setAuthorityService

        public void setAuthorityService​(org.alfresco.service.cmr.security.AuthorityService authorityService)
      • setPersonService

        public void setPersonService​(org.alfresco.service.cmr.security.PersonService personService)
      • setStoreRef

        public void setStoreRef​(String storeRef)
      • setCaveatAspects

        public void setCaveatAspects​(List<String> caveatAspectNames)
      • setCaveatModels

        public void setCaveatModels​(List<String> caveatModelNames)
      • onContentUpdate

        public void onContentUpdate​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                    boolean newContent)
        Specified by:
        onContentUpdate in interface org.alfresco.repo.content.ContentServicePolicies.OnContentUpdatePolicy
        See Also:
        RM-2770 - this method has to be fired on transaction commit to be able to validate the content when the content store is encrypted
      • beforeDeleteNode

        public void beforeDeleteNode​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Specified by:
        beforeDeleteNode in interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy
        See Also:
        NodeServicePolicies.BeforeDeleteNodePolicy.beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef)
      • onCreateNode

        public void onCreateNode​(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
        Specified by:
        onCreateNode in interface org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy
        See Also:
        NodeServicePolicies.OnCreateNodePolicy.onCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef)
      • validateAndReset

        protected void validateAndReset​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Validate the caveat config and optionally update the cache.
        Parameters:
        nodeRef - The nodeRef of the config
      • hasAccess

        public boolean hasAccess​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Check whether access to 'record component' node is vetoed for current user due to caveat(s)
        Specified by:
        hasAccess in interface RMCaveatConfigComponent
        Parameters:
        nodeRef -
        Returns:
        false, if caveat(s) veto access otherwise return true
      • addRMConstraintListValue

        public void addRMConstraintListValue​(String listName,
                                             String authorityName,
                                             String value)
        Add a single value to an authority in a list. The existing values of the list remain.
        Specified by:
        addRMConstraintListValue in interface RMCaveatConfigComponent
        Parameters:
        listName - the name of the RMConstraintList
        authorityName -
        value -
        Throws:
        org.alfresco.error.AlfrescoRuntimeException - if either the list or the authority do not already exist.
      • updateRMConstraintListAuthority

        public void updateRMConstraintListAuthority​(String listName,
                                                    String authorityName,
                                                    List<String> values)
        Replace the values for an authority in a list. The existing values are removed. If the authority does not already exist in the list, it will be added
        Specified by:
        updateRMConstraintListAuthority in interface RMCaveatConfigComponent
        Parameters:
        listName - the name of the RMConstraintList
        authorityName -
        values -
      • getRMConstraint

        public RMConstraintInfo getRMConstraint​(org.alfresco.service.namespace.QName listQName)
        Get an RMConstraintInfo
        Parameters:
        listQName -
        Returns:
        the constraint or null if it does not exist