Interface ModelSecurityService

  • All Known Implementing Classes:
    ModelSecurityServiceImpl

    @AlfrescoPublicApi
    public interface ModelSecurityService
    Model security service interface.
    Since:
    2.1
    Author:
    Roy Wetherall
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean canEditProtectedAspect​(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName aspect)
      Indicates whether the current user can edit (ie add or remove) a protected aspect in the context of a given node.
      boolean canEditProtectedProperty​(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName property)
      Indicates whether the current user can edit a protected property in the context of a given node.
      void disable()
      Disable model security checks for the current thread.
      void enable()
      Enable model security checks for the current thread.
      ProtectedAspect getProtectedAspect​(org.alfresco.service.namespace.QName name)
      Get the details of the protected aspect, returns null if aspect is not protected.
      Set<org.alfresco.service.namespace.QName> getProtectedAspects()
      Get the protected aspects.
      Set<org.alfresco.service.namespace.QName> getProtectedProperties()
      Get the protected properties
      ProtectedProperty getProtectedProperty​(org.alfresco.service.namespace.QName name)
      Get the details of the protected property, returns null if property is not protected.
      boolean isEnabled()
      Indicates whether model security is enabled or not.
      boolean isProtectedAspect​(org.alfresco.service.namespace.QName aspect)
      Indicates whether an aspect is protected or not.
      boolean isProtectedProperty​(org.alfresco.service.namespace.QName property)
      Indicates whether a property is protected or not.
      void register​(ProtectedModelArtifact atrifact)
      Registers a protected model artifact with the service.
      void setEnabled​(boolean enabled)
      Sets whether model security is enabled globally or not.
    • Method Detail

      • setEnabled

        void setEnabled​(boolean enabled)
        Sets whether model security is enabled globally or not.
        Parameters:
        enabled -
      • isEnabled

        boolean isEnabled()
        Indicates whether model security is enabled or not.
        Returns:
      • disable

        void disable()
        Disable model security checks for the current thread.
      • enable

        void enable()
        Enable model security checks for the current thread.
      • register

        void register​(ProtectedModelArtifact atrifact)
        Registers a protected model artifact with the service.
        Parameters:
        atrifact - protected model artifact
      • isProtectedProperty

        boolean isProtectedProperty​(org.alfresco.service.namespace.QName property)
        Indicates whether a property is protected or not.
        Parameters:
        property - name of property
        Returns:
        boolean true if property is protected, false otherwise
      • getProtectedProperties

        Set<org.alfresco.service.namespace.QName> getProtectedProperties()
        Get the protected properties
        Returns:
        Set<QName > all the protected properties
      • getProtectedProperty

        ProtectedProperty getProtectedProperty​(org.alfresco.service.namespace.QName name)
        Get the details of the protected property, returns null if property is not protected.
        Parameters:
        name - name of the protected property
        Returns:
        ProtectedProperty protected property details, null otherwise
      • canEditProtectedProperty

        boolean canEditProtectedProperty​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                         org.alfresco.service.namespace.QName property)
        Indicates whether the current user can edit a protected property in the context of a given node.

        If the property is not protected then returns true.

        Parameters:
        nodeRef - node reference
        property - name of the property
        Returns:
        boolean true if the current user can edit the protected property or the property is not protected, false otherwise
      • isProtectedAspect

        boolean isProtectedAspect​(org.alfresco.service.namespace.QName aspect)
        Indicates whether an aspect is protected or not.
        Parameters:
        aspect - aspect name
        Returns:
        boolean true if aspect is protected, false otherwise
      • getProtectedAspects

        Set<org.alfresco.service.namespace.QName> getProtectedAspects()
        Get the protected aspects.
        Returns:
        Set<QName> all the protected aspects
      • getProtectedAspect

        ProtectedAspect getProtectedAspect​(org.alfresco.service.namespace.QName name)
        Get the details of the protected aspect, returns null if aspect is not protected.
        Parameters:
        name - name of the aspect
        Returns:
        ProtectedAspect protected aspect details, null otherwise
      • canEditProtectedAspect

        boolean canEditProtectedAspect​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                       org.alfresco.service.namespace.QName aspect)
        Indicates whether the current user can edit (ie add or remove) a protected aspect in the context of a given node.

        If the aspect is not protected then returns true.

        Parameters:
        nodeRef - node reference
        aspect - name of the of aspect
        Returns:
        boolean true if the current user can edit the protected aspect or the the aspect is not protected, false otherwise