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(String model)Adds a permission modelbooleancheckPermission(PermissionReference required)Is this permission refernece to a permission and not a permissoinSet?Set<PermissionReference>getAllExposedPermissions()Get all exposed permissions (regardless of type exposure)Set<PermissionReference>getAllPermissions()Get all exposed permissions (regardless of type exposure)Set<PermissionReference>getAllPermissions(NodeRef nodeRef)Get the permissions that can be set for the given node.Set<PermissionReference>getAllPermissions(QName type)Get the permissions that can be set for the given type.Set<PermissionReference>getAllPermissions(QName typeName, Set<QName> aspects)Get the permissions that can be set for the given type.AccessStatusgetDefaultPermission()Set the default access statusAccessStatusgetDefaultPermission(PermissionReference pr)Get the default acces status for the givne permissionSet<PermissionReference>getExposedPermissions(NodeRef nodeRef)Get the permissions that are exposed to be set for the given node.Set<PermissionReference>getExposedPermissions(QName type)Get the permissions that are exposed to be set for the given type.Set<? extends PermissionEntry>getGlobalPermissionEntries()Get the global permissions for the model.Set<PermissionReference>getGranteePermissions(PermissionReference permissionReference)Get the permissions which are granted by the supplied permission.Set<PermissionReference>getGrantingPermissions(PermissionReference permissionReference)Get all the permissions that grant this permission.Set<PermissionReference>getImmediateGranteePermissions(PermissionReference permissionReference)Get the permissions which are granted by the supplied permission.PermissionReferencegetPermissionReference(QName qname, String permissionName)Find a permission by name in the type context.Map<QName,PermissionSet>getPermissionSets()Get the permission sets by typeSet<PermissionReference>getRequiredPermissions(PermissionReference required, QName qName, Set<QName> aspectQNames, RequiredPermission.On on)Get the permissions that must also be present on the node for the required permission to apply.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(DictionaryService dictionaryService)Set the dictionary servicevoidsetDtdSchema(String dtdSchema)Set the dtd schema that is used to validate permission modelvoidsetModel(String model)Set the modelvoidsetNodeService(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(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 themodel.
-
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: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 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: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 Set<PermissionReference> getExposedPermissions(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 Set<PermissionReference> getAllPermissions(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 Set<PermissionReference> getExposedPermissions(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 Set<PermissionReference> getAllPermissions(QName typeName, Set<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 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 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 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(QName qname, 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 Set<PermissionReference> getRequiredPermissions(PermissionReference required, QName qName, Set<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 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 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 Set<PermissionReference> getAllPermissions()
Description copied from interface:ModelDAOGet all exposed permissions (regardless of type exposure)- Specified by:
getAllPermissionsin interfaceModelDAO
-
-