Class PermissionModel
- java.lang.Object
-
- org.alfresco.repo.security.permissions.impl.model.PermissionModel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPermissionModel.RequiredKeyCache key
-
Constructor Summary
Constructors Constructor Description PermissionModel()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPermissionModel(java.lang.String model)Adds a permission modelbooleancheckPermission(PermissionReference required)Is this permission refernece to a permission and not a permissoinSet?java.util.Set<PermissionReference>getAllExposedPermissions()Get all exposed permissions (regardless of type exposure)java.util.Set<PermissionReference>getAllPermissions()Get all exposed permissions (regardless of type exposure)java.util.Set<PermissionReference>getAllPermissions(org.alfresco.service.cmr.repository.NodeRef nodeRef)Get the permissions that can be set for the given node.java.util.Set<PermissionReference>getAllPermissions(org.alfresco.service.namespace.QName type)Get the permissions that can be set for the given type.java.util.Set<PermissionReference>getAllPermissions(org.alfresco.service.namespace.QName typeName, java.util.Set<org.alfresco.service.namespace.QName> aspects)Get the permissions that can be set for the given type.org.alfresco.service.cmr.security.AccessStatusgetDefaultPermission()Set the default access statusorg.alfresco.service.cmr.security.AccessStatusgetDefaultPermission(PermissionReference pr)Get the default acces status for the givne permissionjava.util.Set<PermissionReference>getExposedPermissions(org.alfresco.service.cmr.repository.NodeRef nodeRef)Get the permissions that are exposed to be set for the given node.java.util.Set<PermissionReference>getExposedPermissions(org.alfresco.service.namespace.QName type)Get the permissions that are exposed to be set for the given type.java.util.Set<? extends PermissionEntry>getGlobalPermissionEntries()Get the global permissions for the model.java.util.Set<PermissionReference>getGranteePermissions(PermissionReference permissionReference)Get the permissions which are granted by the supplied permission.java.util.Set<PermissionReference>getGrantingPermissions(PermissionReference permissionReference)Get all the permissions that grant this permission.java.util.Set<PermissionReference>getImmediateGranteePermissions(PermissionReference permissionReference)Get the permissions which are granted by the supplied permission.PermissionReferencegetPermissionReference(org.alfresco.service.namespace.QName qname, java.lang.String permissionName)Find a permission by name in the type context.java.util.Map<org.alfresco.service.namespace.QName,PermissionSet>getPermissionSets()Get the permission sets by typejava.util.Set<PermissionReference>getRequiredPermissions(PermissionReference required, org.alfresco.service.namespace.QName qName, java.util.Set<org.alfresco.service.namespace.QName> aspectQNames, RequiredPermission.On on)Get the permissions that must also be present on the node for the required permission to apply.java.util.Set<PermissionReference>getUnconditionalRequiredPermissions(PermissionReference required, RequiredPermission.On on)booleanhasFull(PermissionReference permissionReference)Does this permission allow full control?voidinit()Adds themodel.booleanisUnique(PermissionReference permissionReference)Does the permission reference have a unique name?voidsetDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)Set the dictionary servicevoidsetDtdSchema(java.lang.String dtdSchema)Set the dtd schema that is used to validate permission modelvoidsetModel(java.lang.String model)Set the modelvoidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)Set the node servicevoidsetValidate(boolean validate)Indicates whether model should be validated on initialization against specified dtd
-
-
-
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 themodel.
-
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:ModelDAOGet the global permissions for the model. Permissions that apply to all nodes and take precedence over node specific permissions.- Specified by:
getGlobalPermissionEntriesin interfaceModelDAO- 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:ModelDAOGet the permissions that can be set for the given type.- Specified by:
getAllPermissionsin interfaceModelDAO- 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:ModelDAOGet the permissions that are exposed to be set for the given type.- Specified by:
getExposedPermissionsin interfaceModelDAO- 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:ModelDAOGet the permissions that can be set for the given node. This is determined by the node type.- Specified by:
getAllPermissionsin interfaceModelDAO- Parameters:
nodeRef- NodeRef
-
getExposedPermissions
public java.util.Set<PermissionReference> getExposedPermissions(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Description copied from interface:ModelDAOGet the permissions that are exposed to be set for the given node. This is determined by the node type.- Specified by:
getExposedPermissionsin interfaceModelDAO- 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:ModelDAOGet the permissions that can be set for the given type.- Specified by:
getAllPermissionsin interfaceModelDAO- Parameters:
typeName- - the type in the data dictionary.
-
getGrantingPermissions
public java.util.Set<PermissionReference> getGrantingPermissions(PermissionReference permissionReference)
Description copied from interface:ModelDAOGet all the permissions that grant this permission.- Specified by:
getGrantingPermissionsin interfaceModelDAO- Parameters:
permissionReference- PermissionReference
-
checkPermission
public boolean checkPermission(PermissionReference required)
Description copied from interface:ModelDAOIs this permission refernece to a permission and not a permissoinSet?- Specified by:
checkPermissionin interfaceModelDAO- Parameters:
required- PermissionReference- Returns:
- boolean
-
getGranteePermissions
public java.util.Set<PermissionReference> getGranteePermissions(PermissionReference permissionReference)
Description copied from interface:ModelDAOGet the permissions which are granted by the supplied permission.- Specified by:
getGranteePermissionsin interfaceModelDAO- Parameters:
permissionReference- PermissionReference
-
getImmediateGranteePermissions
public java.util.Set<PermissionReference> getImmediateGranteePermissions(PermissionReference permissionReference)
Description copied from interface:ModelDAOGet the permissions which are granted by the supplied permission.- Specified by:
getImmediateGranteePermissionsin interfaceModelDAO- Parameters:
permissionReference- PermissionReference
-
getPermissionReference
public PermissionReference getPermissionReference(org.alfresco.service.namespace.QName qname, java.lang.String permissionName)
Description copied from interface:ModelDAOFind 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:
getPermissionReferencein interfaceModelDAO- Parameters:
qname- QNamepermissionName- 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:ModelDAOGet the permissions that must also be present on the node for the required permission to apply.- Specified by:
getRequiredPermissionsin interfaceModelDAO- Parameters:
required- PermissionReferenceqName- QNameon- RequiredPermission.On
-
getUnconditionalRequiredPermissions
public java.util.Set<PermissionReference> getUnconditionalRequiredPermissions(PermissionReference required, RequiredPermission.On on)
- Specified by:
getUnconditionalRequiredPermissionsin interfaceModelDAO
-
isUnique
public boolean isUnique(PermissionReference permissionReference)
Description copied from interface:ModelDAODoes the permission reference have a unique name?
-
getAllExposedPermissions
public java.util.Set<PermissionReference> getAllExposedPermissions()
Description copied from interface:ModelDAOGet all exposed permissions (regardless of type exposure)- Specified by:
getAllExposedPermissionsin interfaceModelDAO
-
hasFull
public boolean hasFull(PermissionReference permissionReference)
Description copied from interface:ModelDAODoes this permission allow full control?
-
getAllPermissions
public java.util.Set<PermissionReference> getAllPermissions()
Description copied from interface:ModelDAOGet all exposed permissions (regardless of type exposure)- Specified by:
getAllPermissionsin interfaceModelDAO
-
-