org.alfresco.repo.security.permissions.impl.model
Class PermissionModel

java.lang.Object
  extended by org.alfresco.repo.security.permissions.impl.model.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


Nested Class Summary
static class PermissionModel.RequiredKey
          Cache key
 
Constructor Summary
PermissionModel()
          Default constructor
 
Method Summary
 void addPermissionModel(java.lang.String model)
          Adds a permission model
 boolean checkPermission(PermissionReference required)
          Is this permission refernece to a permission and not a permissoinSet?
 java.util.Set getAllExposedPermissions()
          Get all exposed permissions (regardless of type exposure)
 java.util.Set getAllPermissions()
          Get all exposed permissions (regardless of type exposure)
 java.util.Set getAllPermissions(org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Get the permissions that can be set for the given node.
 java.util.Set getAllPermissions(org.alfresco.service.namespace.QName type)
          Get the permissions that can be set for the given type.
 java.util.Set getAllPermissions(org.alfresco.service.namespace.QName typeName, java.util.Set aspects)
          Get the permissions that can be set for the given type.
 org.alfresco.service.cmr.security.AccessStatus getDefaultPermission()
          Set the default access status
 org.alfresco.service.cmr.security.AccessStatus getDefaultPermission(PermissionReference pr)
          Get the default acces status for the givne permission
 java.util.Set getExposedPermissions(org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Get the permissions that are exposed to be set for the given node.
 java.util.Set getExposedPermissions(org.alfresco.service.namespace.QName type)
          Get the permissions that are exposed to be set for the given type.
 java.util.Set getGlobalPermissionEntries()
          Get the global permissions for the model.
 java.util.Set getGranteePermissions(PermissionReference permissionReference)
          Get the permissions which are granted by the supplied permission.
 java.util.Set getGrantingPermissions(PermissionReference permissionReference)
          Get all the permissions that grant this permission.
 java.util.Set getImmediateGranteePermissions(PermissionReference permissionReference)
          Get the permissions which are granted by the supplied permission.
 PermissionReference getPermissionReference(org.alfresco.service.namespace.QName qname, java.lang.String permissionName)
          Find a permission by name in the type context.
 java.util.Map getPermissionSets()
          Get the permission sets by type
 java.util.Set getRequiredPermissions(PermissionReference required, org.alfresco.service.namespace.QName qName, java.util.Set aspectQNames, RequiredPermission.On on)
          Get the permissions that must also be present on the node for the required permission to apply.
 java.util.Set getUnconditionalRequiredPermissions(PermissionReference required, RequiredPermission.On on)
           
 boolean hasFull(PermissionReference permissionReference)
          Does this permission allow full control?
 void init()
          Adds the model.
 boolean isUnique(PermissionReference permissionReference)
          Does the permission reference have a unique name?
 void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
          Set the dictionary service
 void setDtdSchema(java.lang.String dtdSchema)
          Set the dtd schema that is used to validate permission model
 void setModel(java.lang.String model)
          Set the model
 void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
          Set the node service
 void setValidate(boolean validate)
          Indicates whether model should be validated on initialization against specified dtd
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermissionModel

public PermissionModel()
Default constructor

Method Detail

setModel

public void setModel(java.lang.String model)
Set the model

Parameters:
model -

setDtdSchema

public void setDtdSchema(java.lang.String dtdSchema)
Set the dtd schema that is used to validate permission model

Parameters:
dtdSchema -

setValidate

public void setValidate(boolean validate)
Indicates whether model should be validated on initialization against specified dtd

Parameters:
validate -

setDictionaryService

public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Set the dictionary service

Parameters:
dictionaryService -

setNodeService

public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Set the node service

Parameters:
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 -
Returns:
the access status

getGlobalPermissionEntries

public java.util.Set 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:

getPermissionSets

public java.util.Map getPermissionSets()
Get the permission sets by type

Returns:
the permission sets by type

getAllPermissions

public java.util.Set 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.
Returns:

getExposedPermissions

public java.util.Set 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.
Returns:

getAllPermissions

public java.util.Set 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
Returns:

getExposedPermissions

public java.util.Set 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
Returns:

getAllPermissions

public java.util.Set getAllPermissions(org.alfresco.service.namespace.QName typeName,
                                       java.util.Set 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.
Returns:

getGrantingPermissions

public java.util.Set getGrantingPermissions(PermissionReference permissionReference)
Description copied from interface: ModelDAO
Get all the permissions that grant this permission.

Specified by:
getGrantingPermissions in interface ModelDAO
Returns:

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
Returns:

getGranteePermissions

public java.util.Set getGranteePermissions(PermissionReference permissionReference)
Description copied from interface: ModelDAO
Get the permissions which are granted by the supplied permission.

Specified by:
getGranteePermissions in interface ModelDAO
Returns:

getImmediateGranteePermissions

public java.util.Set getImmediateGranteePermissions(PermissionReference permissionReference)
Description copied from interface: ModelDAO
Get the permissions which are granted by the supplied permission.

Specified by:
getImmediateGranteePermissions in interface ModelDAO
Returns:

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
Returns:

getRequiredPermissions

public java.util.Set getRequiredPermissions(PermissionReference required,
                                            org.alfresco.service.namespace.QName qName,
                                            java.util.Set 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
Returns:

getUnconditionalRequiredPermissions

public java.util.Set 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
Returns:

getAllExposedPermissions

public java.util.Set getAllExposedPermissions()
Description copied from interface: ModelDAO
Get all exposed permissions (regardless of type exposure)

Specified by:
getAllExposedPermissions in interface ModelDAO
Returns:

hasFull

public boolean hasFull(PermissionReference permissionReference)
Description copied from interface: ModelDAO
Does this permission allow full control?

Specified by:
hasFull in interface ModelDAO
Returns:

getAllPermissions

public java.util.Set getAllPermissions()
Description copied from interface: ModelDAO
Get all exposed permissions (regardless of type exposure)

Specified by:
getAllPermissions in interface ModelDAO
Returns:


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.