Class PermissionModel

  • All Implemented Interfaces:
    ModelDAO

    public class PermissionModel
    extends java.lang.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 Detail

      • PermissionModel

        public PermissionModel()
        Default constructor
    • Method Detail

      • setModel

        public void setModel​(java.lang.String model)
        Set the model
        Parameters:
        model - String
      • setDtdSchema

        public void setDtdSchema​(java.lang.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​(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
        Set the dictionary service
        Parameters:
        dictionaryService - DictionaryService
      • setNodeService

        public void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)
        Set the node service
        Parameters:
        nodeService - NodeService
      • init

        public void init()
        Adds the model.
      • addPermissionModel

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

        public org.alfresco.service.cmr.security.AccessStatus getDefaultPermission()
        Set the default access status
        Returns:
        the default access status
      • getDefaultPermission

        public org.alfresco.service.cmr.security.AccessStatus getDefaultPermission​(PermissionReference pr)
        Get the default acces status for the givne permission
        Parameters:
        pr - PermissionReference
        Returns:
        the access status
      • getGlobalPermissionEntries

        public java.util.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 java.util.Map<org.alfresco.service.namespace.QName,​PermissionSet> getPermissionSets()
        Get the permission sets by type
        Returns:
        the permission sets by type
      • getAllPermissions

        public java.util.Set<PermissionReference> getAllPermissions​(org.alfresco.service.namespace.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 java.util.Set<PermissionReference> getExposedPermissions​(org.alfresco.service.namespace.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 java.util.Set<PermissionReference> getAllPermissions​(org.alfresco.service.cmr.repository.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 java.util.Set<PermissionReference> getExposedPermissions​(org.alfresco.service.cmr.repository.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 java.util.Set<PermissionReference> getAllPermissions​(org.alfresco.service.namespace.QName typeName,
                                                                    java.util.Set<org.alfresco.service.namespace.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.
      • 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
      • getPermissionReference

        public PermissionReference getPermissionReference​(org.alfresco.service.namespace.QName qname,
                                                          java.lang.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 java.util.Set<PermissionReference> getRequiredPermissions​(PermissionReference required,
                                                                         org.alfresco.service.namespace.QName qName,
                                                                         java.util.Set<org.alfresco.service.namespace.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
      • 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
      • 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