phpcr/src/PHPCR/Security/PrivilegeInterface.php
Copyright 2008-2011 Karsten Dambekalns karsten@typo3.org
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
\PHPCR\Security\PrivilegeInterface
Each privilege is identified by a JCR name. JCR defines a set of standard privileges in the jcr namespace. Implementations may add additional privileges in namespaces other than jcr.
A privilege may be an aggregate privilege. Aggregate privileges are sets of other privileges. Granting, denying, or testing an aggregate privilege is equivalent to individually granting, denying, or testing each privilege it contains. The privileges contained by an aggregate privilege may themselves be aggregate privileges if the resulting privilege graph is acyclic.
A privilege may be an abstract privilege. Abstract privileges cannot themselves be granted or denied, but can be composed into aggregate privileges which are granted or denied.
A privilege can be both aggregate and abstract.
- Api
Constants
JCR_READ
= "{http://www.jcp.org/jcr/1.0}read"
- Api
JCR_MODIFY_PROPERTIES
= "{http://www.jcp.org/jcr/1.0}modifyProperties"
- Api
JCR_ADD_CHILD_NODES
= "{http://www.jcp.org/jcr/1.0}addChildNodes"
- Api
JCR_REMOVE_NODE
= "{http://www.jcp.org/jcr/1.0}removeNode"
In order to actually remove a node requires jcr:removeNode on that node and jcr:removeChildNodes on the parent node.
The distinction is provided in order to reflect implementations that internally model "remove" as a "delete" instead of a "unlink". A repository that uses the "delete" model can have jcr:removeChildNodes in every access control policy, so that removal is effectively controlled by jcr:removeNode.
- Api
JCR_REMOVE_CHILD_NODES
= "{http://www.jcp.org/jcr/1.0}removeChildNodes"
In order to actually remove a node requires jcr:removeNode on that node and jcr:removeChildNodes on the parent node.
The distinction is provided in order to reflect implementations that internally model "remove" as a "unlink" instead of a "delete". A repository that uses the "unlink" model can have jcr:removeNode in every access control policy, so that removal is effectively controlled by jcr:removeChildNodes.
- Api
JCR_WRITE
= "{http://www.jcp.org/jcr/1.0}write"
- jcr:modifyProperties
- jcr:addChildNodes
- jcr:removeNode
- jcr:removeChildNodes
- Api
JCR_READ_ACCESS_CONTROL
= "{http://www.jcp.org/jcr/1.0}readAccessControl"
- Api
JCR_MODIFY_ACCESS_CONTROL
= "{http://www.jcp.org/jcr/1.0}modifyAccessControl"
- Api
JCR_LOCK_MANAGEMENT
= "{http://www.jcp.org/jcr/1.0}lockManagement"
- Api
JCR_VERSION_MANAGEMENT
= "{http://www.jcp.org/jcr/1.0}versionManagement"
- Api
JCR_NODE_TYPE_MANAGEMENT
= "{http://www.jcp.org/jcr/1.0}nodeTypeManagement"
- Api
JCR_RETENTION_MANAGEMENT
= "{http://www.jcp.org/jcr/1.0}retentionManagement"
- Api
JCR_LIFECYCLE_MANAGEMENT
= "{http://www.jcp.org/jcr/1.0}lifecycleManagement"
- Api
JCR_WORKSPACE_MANAGEMENT
= "{http://www.jcp.org/jcr/1.0}workspaceManagement"
jcr:workspaceManagement
(in expanded
form), the privilege to create and remove workspaces in the repository.
JCR_NODE_TYPE_DEFINITION_MANAGEMENT
= "{http://www.jcp.org/jcr/1.0}nodeTypeDefinitionManagement"
jcr:nodeTypeDefinitionManagement
(in expanded
form), the privilege to register, unregister and change the definitions
of node type in the repository.
JCR_NAMESPACE_MANAGEMENT
= "{http://www.jcp.org/jcr/1.0}namespaceManagement"
jcr:namespaceManagement
(in expanded
form), the privilege to register, unregister and modify namespace definitions.
JCR_ALL
= "{http://www.jcp.org/jcr/1.0}all"
- jcr:read
- jcr:write
- jcr:readAccessControl
- jcr:modifyAccessControl
- jcr:lockManagement
- jcr:versionManagement
- jcr:nodeTypeManagement
- jcr:retentionManagement
- jcr:lifecycleManagement
- jcr:workspaceManagement
- jcr:nodeTypeDefinitionManagement
- jcr:namespaceManagement
It should, in addition, include all implementation-defined privileges.
- Api
Methods
getAggregatePrivileges() : array
If this privilege is an aggregate privilege, returns the privileges it contains, the privileges contained by any aggregate privileges among those, and so on (the transitive closure of privileges contained by this privilege).
Otherwise returns an empty array.
Type | Description |
---|---|
array | an array of Privileges |
- Api
getDeclaredAggregatePrivileges() : array
If this privilege is an aggregate privilege, returns the privileges directly contained by the aggregate privilege.
Otherwise returns an empty array.
Type | Description |
---|---|
array | an array of Privileges |
- Api
getName() : string
Returns the name of this privilege.
Type | Description |
---|---|
string | the name of this privilege. |
- Api
isAbstract() : boolean
Returns whether this privilege is an abstract privilege.
Type | Description |
---|---|
boolean | true if this privilege is an abstract privilege; false otherwise. |
- Api