Class PermissionModel

java.lang.Object
org.alfresco.repo.security.permissions.impl.model.PermissionModel
All Implemented Interfaces:
ModelDAO

public class PermissionModel extends Object implements ModelDAO
The implementation of the model DAO Reads and stores the top level model information Encapsulates access to this information
Author:
andyh
  • Constructor Details

    • PermissionModel

      public PermissionModel()
      Default constructor
  • Method Details

    • setModel

      public void setModel(String model)
      Set the model
      Parameters:
      model - String
    • setDtdSchema

      public void setDtdSchema(String dtdSchema)
      Set the dtd schema that is used to validate permission model
      Parameters:
      dtdSchema - String
    • setValidate

      public void setValidate(boolean validate)
      Indicates whether model should be validated on initialization against specified dtd
      Parameters:
      validate - boolean
    • setDictionaryService

      public void setDictionaryService(DictionaryService dictionaryService)
      Set the dictionary service
      Parameters:
      dictionaryService - DictionaryService
    • setNodeService

      public void setNodeService(NodeService nodeService)
      Set the node service
      Parameters:
      nodeService - NodeService
    • init

      public void init()
      Adds the model.
    • addPermissionModel

      public void addPermissionModel(String model)
      Adds a permission model
      Parameters:
      model - path to the permission model to add
    • getDefaultPermission

      public AccessStatus getDefaultPermission()
      Set the default access status
      Returns:
      the default access status
    • getDefaultPermission

      public AccessStatus getDefaultPermission(PermissionReference pr)
      Get the default acces status for the givne permission
      Parameters:
      pr - PermissionReference
      Returns:
      the access status
    • getGlobalPermissionEntries

      public Set<? extends PermissionEntry> getGlobalPermissionEntries()
      Description copied from interface: ModelDAO
      Get the global permissions for the model. Permissions that apply to all nodes and take precedence over node specific permissions.
      Specified by:
      getGlobalPermissionEntries in interface ModelDAO
      Returns:
      Set
    • getPermissionSets

      public Map<QName,PermissionSet> getPermissionSets()
      Get the permission sets by type
      Returns:
      the permission sets by type
    • getAllPermissions

      public Set<PermissionReference> getAllPermissions(QName type)
      Description copied from interface: ModelDAO
      Get the permissions that can be set for the given type.
      Specified by:
      getAllPermissions in interface ModelDAO
      Parameters:
      type - - the type in the data dictionary.
    • getExposedPermissions

      public Set<PermissionReference> getExposedPermissions(QName type)
      Description copied from interface: ModelDAO
      Get the permissions that are exposed to be set for the given type.
      Specified by:
      getExposedPermissions in interface ModelDAO
      Parameters:
      type - - the type in the data dictionary.
    • getAllPermissions

      public Set<PermissionReference> getAllPermissions(NodeRef nodeRef)
      Description copied from interface: ModelDAO
      Get the permissions that can be set for the given node. This is determined by the node type.
      Specified by:
      getAllPermissions in interface ModelDAO
      Parameters:
      nodeRef - NodeRef
    • getExposedPermissions

      public Set<PermissionReference> getExposedPermissions(NodeRef nodeRef)
      Description copied from interface: ModelDAO
      Get the permissions that are exposed to be set for the given node. This is determined by the node type.
      Specified by:
      getExposedPermissions in interface ModelDAO
      Parameters:
      nodeRef - NodeRef
    • getAllPermissions

      public Set<PermissionReference> getAllPermissions(QName typeName, Set<QName> aspects)
      Description copied from interface: ModelDAO
      Get the permissions that can be set for the given type.
      Specified by:
      getAllPermissions in interface ModelDAO
      Parameters:
      typeName - - the type in the data dictionary.
    • getGrantingPermissions

      public Set<PermissionReference> getGrantingPermissions(PermissionReference permissionReference)
      Description copied from interface: ModelDAO
      Get all the permissions that grant this permission.
      Specified by:
      getGrantingPermissions in interface ModelDAO
      Parameters:
      permissionReference - PermissionReference
    • checkPermission

      public boolean checkPermission(PermissionReference required)
      Description copied from interface: ModelDAO
      Is this permission refernece to a permission and not a permissoinSet?
      Specified by:
      checkPermission in interface ModelDAO
      Parameters:
      required - PermissionReference
      Returns:
      boolean
    • getGranteePermissions

      public Set<PermissionReference> getGranteePermissions(PermissionReference permissionReference)
      Description copied from interface: ModelDAO
      Get the permissions which are granted by the supplied permission.
      Specified by:
      getGranteePermissions in interface ModelDAO
      Parameters:
      permissionReference - PermissionReference
    • getImmediateGranteePermissions

      public Set<PermissionReference> getImmediateGranteePermissions(PermissionReference permissionReference)
      Description copied from interface: ModelDAO
      Get the permissions which are granted by the supplied permission.
      Specified by:
      getImmediateGranteePermissions in interface ModelDAO
      Parameters:
      permissionReference - PermissionReference
    • getPermissionReference

      public PermissionReference getPermissionReference(QName qname, String permissionName)
      Description copied from interface: ModelDAO
      Find a permission by name in the type context. If the context is null and the permission name is unique it will be found.
      Specified by:
      getPermissionReference in interface ModelDAO
      Parameters:
      qname - QName
      permissionName - String
      Returns:
      PermissionReference
    • getRequiredPermissions

      public Set<PermissionReference> getRequiredPermissions(PermissionReference required, QName qName, Set<QName> aspectQNames, RequiredPermission.On on)
      Description copied from interface: ModelDAO
      Get the permissions that must also be present on the node for the required permission to apply.
      Specified by:
      getRequiredPermissions in interface ModelDAO
      Parameters:
      required - PermissionReference
      qName - QName
      on - RequiredPermission.On
    • getUnconditionalRequiredPermissions

      public Set<PermissionReference> getUnconditionalRequiredPermissions(PermissionReference required, RequiredPermission.On on)
      Specified by:
      getUnconditionalRequiredPermissions in interface ModelDAO
    • isUnique

      public boolean isUnique(PermissionReference permissionReference)
      Description copied from interface: ModelDAO
      Does the permission reference have a unique name?
      Specified by:
      isUnique in interface ModelDAO
      Parameters:
      permissionReference - PermissionReference
      Returns:
      boolean
    • getAllExposedPermissions

      public Set<PermissionReference> getAllExposedPermissions()
      Description copied from interface: ModelDAO
      Get all exposed permissions (regardless of type exposure)
      Specified by:
      getAllExposedPermissions in interface ModelDAO
    • hasFull

      public boolean hasFull(PermissionReference permissionReference)
      Description copied from interface: ModelDAO
      Does this permission allow full control?
      Specified by:
      hasFull in interface ModelDAO
      Parameters:
      permissionReference - PermissionReference
      Returns:
      boolean
    • getAllPermissions

      public Set<PermissionReference> getAllPermissions()
      Description copied from interface: ModelDAO
      Get all exposed permissions (regardless of type exposure)
      Specified by:
      getAllPermissions in interface ModelDAO