You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by an...@apache.org on 2009/03/10 11:51:05 UTC

svn commit: r752056 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization: ./ acl/ principalbased/

Author: angela
Date: Tue Mar 10 10:51:04 2009
New Revision: 752056

URL: http://svn.apache.org/viewvc?rev=752056&view=rev
Log:
javadoc

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AbstractCompiledPermissions.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlEditor.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlEntryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProvider.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProviderFactory.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlUtils.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/JackrabbitAccessControlEntry.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/JackrabbitAccessControlPolicy.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/PrivilegeRegistry.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/UnmodifiableAccessControlList.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/WorkspaceAccessManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplate.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLTemplate.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AbstractCompiledPermissions.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AbstractCompiledPermissions.java?rev=752056&r1=752055&r2=752056&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AbstractCompiledPermissions.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AbstractCompiledPermissions.java Tue Mar 10 10:51:04 2009
@@ -35,8 +35,9 @@
 
     /**
      *
-     * @param absPath
+     * @param absPath Absolute path to return the result for.
      * @return the <code>Result</code> for the give <code>absPath</code>.
+     * @throws RepositoryException if an error occurs.
      */
     public Result getResult(Path absPath) throws RepositoryException {
         Result result;
@@ -52,9 +53,9 @@
 
     /**
      *
-     * @param absPath
-     * @return
-     * @throws RepositoryException
+     * @param absPath Absolute path to build the result for.
+     * @return Result for the specified <code>absPath</code>.
+     * @throws RepositoryException If an error occurs.
      */
     protected abstract Result buildResult(Path absPath) throws RepositoryException;
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlEditor.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlEditor.java?rev=752056&r1=752055&r2=752056&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlEditor.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlEditor.java Tue Mar 10 10:51:04 2009
@@ -81,7 +81,11 @@
     /**
      * Returns an array of editable policies for the given <code>principal</code>.
      *
+     * @param principal Principal for which the editable policies should be
+     * returned.
      * @return an array of editable policies for the given <code>principal</code>.
+     * @throws AccessDeniedException If the editing session is not allowed to
+     * edit policies.
      * @throws AccessControlException if the specified principal does not exist,
      * if this implementation cannot provide policies for individual principals or
      * if same other access control related exception occurs.

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlEntryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlEntryImpl.java?rev=752056&r1=752055&r2=752056&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlEntryImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlEntryImpl.java Tue Mar 10 10:51:04 2009
@@ -74,8 +74,9 @@
     /**
      * Construct an access control entry for the given principal and privileges.
      *
-     * @param principal
-     * @param privileges
+     * @param principal Principal for this access control entry.
+     * @param privileges Privileges for this access control entry.
+     * @throws AccessControlException if either principal or privileges are invalid.
      */
     protected AccessControlEntryImpl(Principal principal, Privilege[] privileges)
             throws AccessControlException {
@@ -85,10 +86,14 @@
     /**
      * Construct an access control entry for the given principal and privileges.
      *
-     * @param principal
-     * @param privileges
-     * @param isAllow
-     * @param restrictions
+     * @param principal Principal for this access control entry.
+     * @param privileges Privileges for this access control entry.
+     * @param isAllow <code>true</code> if this ACE grants the specified
+     * privileges to the specified principal; <code>false</code> otherwise.
+     * @param restrictions A map of restriction name (String) to restriction
+     * (Value). See {@link org.apache.jackrabbit.core.security.authorization.JackrabbitAccessControlList#getRestrictionNames()}
+     * and {@link org.apache.jackrabbit.core.security.authorization.JackrabbitAccessControlList#getRestrictionType(String)}. 
+     * @throws AccessControlException if either principal or privileges are invalid.
      */
     protected AccessControlEntryImpl(Principal principal, Privilege[] privileges,
                                      boolean isAllow, Map restrictions)

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProvider.java?rev=752056&r1=752055&r2=752056&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProvider.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProvider.java Tue Mar 10 10:51:04 2009
@@ -59,8 +59,9 @@
      * Allows the {@link AccessControlProviderFactory} to pass a session
      * and configuration parameters to the <code>AccessControlProvider</code>.
      *
-     * @param systemSession
-     * @param configuration
+     * @param systemSession System session.
+     * @param configuration Configuration used to initialize this provider.
+     * @throws RepositoryException If an error occurs.
      */
     void init(Session systemSession, Map configuration) throws RepositoryException;
 
@@ -113,11 +114,12 @@
      * root node of the workspace this provider has been built for;
      * <code>false</code> otherwise.
      *
-     * @param principals
+     * @param principals Set of principals to be tested for being allowed to
+     * access the root node.
      * @return <code>true</code> if the given set of principals can access the
      * root node of the workspace this provider has been built for;
      * <code>false</code> otherwise.
-     * @throws RepositoryException
+     * @throws RepositoryException If an error occurs.
      */
     boolean canAccessRoot(Set principals) throws RepositoryException;
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProviderFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProviderFactory.java?rev=752056&r1=752055&r2=752056&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProviderFactory.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProviderFactory.java Tue Mar 10 10:51:04 2009
@@ -42,7 +42,8 @@
     /**
      * Initalize this factory.
      *
-     * @param securitySession
+     * @param securitySession Security Session.
+     * @throws RepositoryException If an error occurs.
      */
     void init(Session securitySession) throws RepositoryException;
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlUtils.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlUtils.java?rev=752056&r1=752055&r2=752056&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlUtils.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlUtils.java Tue Mar 10 10:51:04 2009
@@ -31,9 +31,10 @@
      * Test if the specified path points to an item that defines AC
      * information.
      *
-     * @param absPath
+     * @param absPath Path to an item.
      * @return true if the item at the specified <code>absPath</code> contains
      * access control information.
+     * @throws RepositoryException If an error occurs.
      */
     boolean isAcItem(Path absPath) throws RepositoryException;
 
@@ -41,10 +42,11 @@
      * Test if the specified path points to an item that defines AC
      * information and consequently should be considered protected.
      *
-     * @param item
+     * @param item An item.
      * @return true if the item at the specified <code>item</code> defines
      * access control related information is should therefore be considered
      * protected.
+     * @throws RepositoryException If an error occurs.
      */
     boolean isAcItem(ItemImpl item) throws RepositoryException;
 
@@ -52,7 +54,7 @@
      * Test if the specified set of principals contains an admin or system
      * principal.
      *
-     * @param principals
+     * @param principals A set of principals.
      * @return true if the specified set of principals contains an
      * <code>AdminPrincipal</code> or a <code>SystemPrincipal</code>.
      */
@@ -63,7 +65,7 @@
      * only. False otherwise (or if it cannot be determined from the principal
      * set only).
      *
-     * @param principals
+     * @param principals A set of principals.
      * @return true if the specified set of principals will only be granted
      * read permission on all items.
      */

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/JackrabbitAccessControlEntry.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/JackrabbitAccessControlEntry.java?rev=752056&r1=752055&r2=752056&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/JackrabbitAccessControlEntry.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/JackrabbitAccessControlEntry.java Tue Mar 10 10:51:04 2009
@@ -44,7 +44,8 @@
      * Return the value of the restriction with the specified name or
      * <code>null</code> if no such restriction exists.
      *
-     * @param restrictionName
+     * @param restrictionName The of the restriction as obtained through
+     * {@link #getRestrictionNames()}.
      * @return value of the restriction with the specified name or
      * <code>null</code> if no such restriction exists
      */

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/JackrabbitAccessControlPolicy.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/JackrabbitAccessControlPolicy.java?rev=752056&r1=752055&r2=752056&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/JackrabbitAccessControlPolicy.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/JackrabbitAccessControlPolicy.java Tue Mar 10 10:51:04 2009
@@ -17,13 +17,6 @@
 package org.apache.jackrabbit.core.security.authorization;
 
 import org.apache.jackrabbit.api.jsr283.security.AccessControlPolicy;
-import org.apache.jackrabbit.api.jsr283.security.AccessControlList;
-import org.apache.jackrabbit.api.jsr283.security.AccessControlException;
-import org.apache.jackrabbit.api.jsr283.security.Privilege;
-
-import javax.jcr.RepositoryException;
-import java.security.Principal;
-import java.util.Map;
 
 /**
  * <code>JackrabbitAccessControlPolicy</code> is an extension of the

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/PrivilegeRegistry.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/PrivilegeRegistry.java?rev=752056&r1=752055&r2=752056&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/PrivilegeRegistry.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/PrivilegeRegistry.java Tue Mar 10 10:51:04 2009
@@ -153,7 +153,7 @@
     /**
      * Returns the privilege with the specified <code>privilegeName</code>.
      *
-     * @param privilegeName
+     * @param privilegeName Name of the principal.
      * @return the privilege with the specified <code>privilegeName</code>.
      * @throws AccessControlException If no privilege with the given name exists.
      * @throws RepositoryException If another error occurs.
@@ -175,10 +175,11 @@
      * <code>bits</code>. If <code>bits</code> is {@link #NO_PRIVILEGE 0} or
      * does not match to any registered privilege an empty array will be returned.
      *
-     * @param bits
+     * @param bits Privilege bits as obtained from {@link #getBits(Privilege[])}.
      * @return Array of <code>Privilege</code>s that are presented by the given it
      * or an empty array if <code>bits</code> is lower than {@link #READ} or
      * cannot be resolved to registered <code>Privilege</code>s.
+     * @see #getBits(Privilege[])
      */
     public Privilege[] getPrivileges(int bits) {
         Privilege[] privs;
@@ -195,10 +196,11 @@
     }
 
     /**
-     * @param privileges
-     * @return
+     * @param privileges An array of privileges.
+     * @return The privilege bits.
      * @throws AccessControlException If the specified array is null
      * or if it contains an unregistered privilege.
+     * @see #getPrivileges(int)
      */
     public static int getBits(Privilege[] privileges) throws AccessControlException {
         if (privileges == null || privileges.length == 0) {
@@ -224,8 +226,10 @@
      * @param parentPrivs The privileges granted on the parent of the Node. Not
      * relevant for properties since it only is used to determine permissions
      * on a Node (add_child_nodes, remove_child_nodes).
-     * @param isAllow
-     * @param protectsPolicy
+     * @param isAllow <code>true</code> if the privileges are granted; <code>false</code>
+     * otherwise.
+     * @param protectsPolicy If <code>true</code> the affected item itself
+     * defines access control related information.
      * @return the permissions granted evaluating the given privileges.
      */
     public static int calculatePermissions(int privs, int parentPrivs, boolean isAllow, boolean protectsPolicy) {
@@ -299,8 +303,7 @@
     }
     
     /**
-     *
-     * @param bits
+     * @param bits The privilege bits.
      * @return InternalPrivilege that corresponds to the given bits.
      */
     private static InternalPrivilege[] getInteralPrivileges(int bits) {
@@ -386,6 +389,8 @@
 
         /**
          * Create a simple (non-aggregate) internal privilege.
+         * @param name The JCR name of the privilege in the extended form.
+         * @param bits The privilege bits.
          */
         private InternalPrivilege(String name, int bits) {
             if (name == null) {
@@ -402,6 +407,8 @@
 
         /**
          * Create an aggregate internal privilege
+         * @param name The JCR name of the privilege in its extended form.
+         * @param declaredAggregates The declared aggregated privileges.
          */
         private InternalPrivilege(String name, InternalPrivilege[] declaredAggregates) {
             if (name == null) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/UnmodifiableAccessControlList.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/UnmodifiableAccessControlList.java?rev=752056&r1=752055&r2=752056&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/UnmodifiableAccessControlList.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/UnmodifiableAccessControlList.java Tue Mar 10 10:51:04 2009
@@ -39,7 +39,10 @@
     /**
      * Construct a new <code>UnmodifiableAccessControlList</code>
      *
-     * @param acl
+     * @param acl The AccessControlList to be wrapped in order to prevent
+     * it's modification.
+     * @throws RepositoryException The the entries cannot be retrieved from the
+     * specified <code>AccessControlList</code>.
      */
     public UnmodifiableAccessControlList(AccessControlList acl) throws RepositoryException {
         accessControlEntries = acl.getAccessControlEntries();
@@ -48,7 +51,7 @@
     /**
      * Construct a new <code>UnmodifiableAccessControlList</code>
      *
-     * @param accessControlEntries
+     * @param accessControlEntries A list of {@link AccessControlEntry access control entries}.
      */
     public UnmodifiableAccessControlList(List accessControlEntries) {
         this.accessControlEntries = (AccessControlEntry[]) accessControlEntries.toArray(new AccessControlEntry[accessControlEntries.size()]);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/WorkspaceAccessManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/WorkspaceAccessManager.java?rev=752056&r1=752055&r2=752056&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/WorkspaceAccessManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/WorkspaceAccessManager.java Tue Mar 10 10:51:04 2009
@@ -30,7 +30,7 @@
     /**
      * Initialize this <code>WorkspaceAccessManager</code>.
      *
-     * @param securitySession
+     * @param securitySession The security session.
      * @throws RepositoryException if an error occurs.
      */
     void init(Session securitySession) throws RepositoryException;
@@ -46,10 +46,12 @@
      * Returns <code>true</code> if access to the workspace with the given name
      * is granted to the to any of the specified principals.
      *
-     * @param principals
-     * @param workspaceName
+     * @param principals A set of principals to be tested for being allowed to
+     * access workspace identified by <code>workspaceName</code>.
+     * @param workspaceName Name of the workspace to be tested.
      * @return true if the given set of principals is allowed to access the
-     * workspace with the specified name. 
+     * workspace with the specified name.
+     * @throws RepositoryException If an error occurs. 
      */
     boolean grants(Set principals, String workspaceName) throws RepositoryException;
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplate.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplate.java?rev=752056&r1=752055&r2=752056&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplate.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplate.java Tue Mar 10 10:51:04 2009
@@ -83,6 +83,7 @@
      * Construct a new empty {@link ACLTemplate}.
      *
      * @param path
+     * @param privilegeRegistry
      * @param principalMgr
      */
     ACLTemplate(String path, PrincipalManager principalMgr, PrivilegeRegistry privilegeRegistry) {
@@ -94,6 +95,10 @@
     /**
      * Create a {@link ACLTemplate} that is used to edit an existing ACL
      * node.
+     *
+     * @param aclNode
+     * @param privilegeRegistry
+     * @throws RepositoryException
      */
     ACLTemplate(NodeImpl aclNode, PrivilegeRegistry privilegeRegistry) throws RepositoryException {
         if (aclNode == null || !aclNode.isNodeType(AccessControlConstants.NT_REP_ACL)) {
@@ -403,7 +408,7 @@
     /**
      * Returns true if the path and the entries are equal; false otherwise.
      *
-     * @param obj
+     * @param obj Object to be tested.
      * @return true if the path and the entries are equal; false otherwise.
      * @see Object#equals(Object)
      */

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLTemplate.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLTemplate.java?rev=752056&r1=752055&r2=752056&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLTemplate.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLTemplate.java Tue Mar 10 10:51:04 2009
@@ -285,7 +285,7 @@
     /**
      * Returns true if the path and the entries are equal; false otherwise.
      *
-     * @param obj
+     * @param obj Object to test.
      * @return true if the path and the entries are equal; false otherwise.
      * @see Object#equals(Object)
      */