You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by an...@apache.org on 2014/05/14 19:16:22 UTC

svn commit: r1594646 - in /jackrabbit/oak/trunk/oak-doc/src/site/markdown/security: accesscontrol.md privilege.md

Author: angela
Date: Wed May 14 17:16:22 2014
New Revision: 1594646

URL: http://svn.apache.org/r1594646
Log:
OAK-301 : oak docu

Modified:
    jackrabbit/oak/trunk/oak-doc/src/site/markdown/security/accesscontrol.md
    jackrabbit/oak/trunk/oak-doc/src/site/markdown/security/privilege.md

Modified: jackrabbit/oak/trunk/oak-doc/src/site/markdown/security/accesscontrol.md
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-doc/src/site/markdown/security/accesscontrol.md?rev=1594646&r1=1594645&r2=1594646&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-doc/src/site/markdown/security/accesscontrol.md (original)
+++ jackrabbit/oak/trunk/oak-doc/src/site/markdown/security/accesscontrol.md Wed May 14 17:16:22 2014
@@ -22,11 +22,21 @@ Access Control
 
 _todo_
 
+- `AccessControlManager`
+- `AccessControlPolicy`
+    - `AccessControlList`
+    - `NamedAccessControlPolicy`
+- `AccessControlEntry`
+- `AccessControlPolicyIterator`
 
 ### Jackrabbit API
 
 _todo_
 
+- `JackrabbitAccessControlManager`
+- `JackrabbitAccessControlList`
+- `JackrabbitAccessControlEntry`
+
 ### Oak API
 
 _todo_
@@ -155,21 +165,6 @@ org.apache.jackrabbit.oak.spi.security.a
 
 See [Restriction Management](accesscontrol/restriction.html) for details.
 
-
-### Utilities
-
-The jcr-commons module present with Jackrabbit provide some access control related
-utilities that simplify the creation of new policies and entries such as for example:
-
-- `AccessControlUtils.getAccessControlList(Session, String)`
-- `AccessControlUtils.getAccessControlList(AccessControlManager, String)`
-- `AccessControlUtils.addAccessControlEntry(Session, String, Principal, String[], boolean)`
-
-See
-[org.apache.jackrabbit.commons.jackrabbit.authorization.AccessControlUtils] for
-the complete list of methods.
-
-
 ### Configuration
 
 The following access control related configuration options are present with the [AuthorizationConfiguration] as of Oak 1.0:
@@ -191,6 +186,28 @@ Differences to Jackrabbit 2.x:
 - The "omit-default-permission" configuration option present with the Jackrabbit's AccessControlProvider implementations is no longer supported with Oak.
 - As of OAK no extra access control content is installed by default which renders that flag superfluous.
 
+
+### Utilities
+
+The jcr-commons module present with Jackrabbit provide some access control related
+utilities that simplify the creation of new policies and entries such as for example:
+
+- `AccessControlUtils.getAccessControlList(Session, String)`
+- `AccessControlUtils.getAccessControlList(AccessControlManager, String)`
+- `AccessControlUtils.addAccessControlEntry(Session, String, Principal, String[], boolean)`
+
+See
+[org.apache.jackrabbit.commons.jackrabbit.authorization.AccessControlUtils] for
+the complete list of methods.
+
+#### Examples
+
+    String path = node.getPath();
+    JackrabbitAccessControlList acl = AccessControlUtils.getAccessControlList(session, path);
+    acl.addEntry(principal, privileges, true);
+    acMgr.setPolicy(path, acl);
+    session.save();
+
 ### Further Reading
 
 - [Differences wrt Jackrabbit 2.x](accesscontrol/differences.html)

Modified: jackrabbit/oak/trunk/oak-doc/src/site/markdown/security/privilege.md
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-doc/src/site/markdown/security/privilege.md?rev=1594646&r1=1594645&r2=1594646&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-doc/src/site/markdown/security/privilege.md (original)
+++ jackrabbit/oak/trunk/oak-doc/src/site/markdown/security/privilege.md Wed May 14 17:16:22 2014
@@ -18,24 +18,13 @@
 Privilege Management
 --------------------------------------------------------------------------------
 
-### Characteristics of the Privilege Management Implementation
+### JCR API
 
-#### General Notes
-As of Oak the built-in and custom privileges are stored in the repository
-underneath `/jcr:system/rep:privileges`. Similar to other repository level date
-(node types, namespaces and versions) this location is shared by all workspaces
-present in the repository. The nodes and properties storing the privilege
-definitions are protected by their node type definition and cannot be modified
-using regular JCR write methods. In addition a specific `Validator` and `CommitHook`
-implementations assert the consistency of the privilege store. The built-in
-privileges are installed using a dedicated implementation of the `RepositoryInitializer`.
+_todo_
 
-#### Differences wrt Jackrabbit 2.x
-A comprehensive list of changes compared to Jackrabbit 2.x can be found in the
-corresponding [documentation](privilege/differences.html).
+- `Privilege`
 
-
-#### Built-in Privilege Definitions
+#### Built-in Privileges
 
 - All Privileges as defined by JSR 283
 
@@ -92,6 +81,48 @@ The new Privileges introduced with Oak 1
 - `rep:removeProperties`: Privilege required in order to remove existing properties (aggreate of `jcr:modifyProperties`)
 - `rep:indexDefinitionManagement`: Privilege required to create, modify or deleate index definitions.
 
+### Jackrabbit API
+
+_todo_
+
+- `PrivilegeManager`
+
+#### Examples
+
+##### Access PrivilegeManager in JCR
+
+    PrivilegeManager privilegeManager = session.getWorkspace().getPrivilegeManager();
+
+##### Access PrivilegeManager in Oak
+
+    Root root = contentSession.getLatestRoot();
+    PrivilegeConfiguration config = securityProvider.getConfiguration(PrivilegeConfiguration.class);
+    PrivilegeManager privilegeManage = config.getPrivilegeManager(root, namePathMapper));
+
+##### Register Custom Privilege
+
+    PrivilegeManager privilegeManager = session.getWorkspace().getPrivilegeManager();
+    String privilegeName = ...
+    boolean isAbstract = ...
+    String[] declaredAggregateNames = ...
+    // NOTE: workspace operation that doesn't require Session#save()
+    privilegeManager.registerPrivilege(privilegeName, isAbstract, declaredAggregateNames);
+
+### Characteristics of the Privilege Management Implementation
+
+#### General Notes
+As of Oak the built-in and custom privileges are stored in the repository
+underneath `/jcr:system/rep:privileges`. Similar to other repository level date
+(node types, namespaces and versions) this location is shared by all workspaces
+present in the repository. The nodes and properties storing the privilege
+definitions are protected by their node type definition and cannot be modified
+using regular JCR write methods. In addition a specific `Validator` and `CommitHook`
+implementations assert the consistency of the privilege store. The built-in
+privileges are installed using a dedicated implementation of the `RepositoryInitializer`.
+
+#### Differences wrt Jackrabbit 2.x
+A comprehensive list of changes compared to Jackrabbit 2.x can be found in the
+corresponding [documentation](privilege/differences.html).
 
 ### Privilege Representation in the Repository
 
@@ -134,27 +165,6 @@ management implementation in Oak, this i
 knowledge and understanding of Jackrabbit/Oak internals and are familiar with
 the security risk associated with it.
 
-#### Examples
-
-##### Access PrivilegeManager in JCR
-
-    PrivilegeManager privilegeManager = session.getWorkspace().getPrivilegeManager();
-
-##### Access PrivilegeManager in Oak
-
-    Root root = contentSession.getLatestRoot();
-    PrivilegeConfiguration config = securityProvider.getConfiguration(PrivilegeConfiguration.class);
-    PrivilegeManager privilegeManage = config.getPrivilegeManager(root, namePathMapper));
-
-##### Register Custom Privilege
-
-    PrivilegeManager privilegeManager = session.getWorkspace().getPrivilegeManager();
-    String privilegeName = ...
-    boolean isAbstract = ...
-    String[] declaredAggregateNames = ...
-    // NOTE: workspace operation that doesn't require Session#save()
-    privilegeManager.registerPrivilege(privilegeName, isAbstract, declaredAggregateNames);
-
 <!-- references -->
 [PrivilegeConfiguration]: /oak/docs/apidocs/org/apache/jackrabbit/oak/spi/security/privilege/PrivilegeConfiguration.html
 [PrivilegeConstants]: /oak/docs/apidocs/org/apache/jackrabbit/oak/spi/security/privilege/PrivilegeConstants.html