Interface ModelSecurityService

All Known Implementing Classes:
ModelSecurityServiceImpl

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

    • 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(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<QName> getProtectedProperties()
      Get the protected properties
      Returns:
      Set<QName > all the protected properties
    • getProtectedProperty

      ProtectedProperty getProtectedProperty(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(NodeRef nodeRef, 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(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<QName> getProtectedAspects()
      Get the protected aspects.
      Returns:
      Set<QName> all the protected aspects
    • getProtectedAspect

      ProtectedAspect getProtectedAspect(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(NodeRef nodeRef, 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