jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1432146 - /jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/jackrabbit/authorization/AccessControlUtils.java
Date Fri, 11 Jan 2013 16:43:32 GMT
Author: angela
Date: Fri Jan 11 16:43:31 2013
New Revision: 1432146

URL: http://svn.apache.org/viewvc?rev=1432146&view=rev
Log:
OAK-51 : Implement JCR Access Control Management: Add more utility methods to AccessControlUtils

Modified:
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/jackrabbit/authorization/AccessControlUtils.java

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/jackrabbit/authorization/AccessControlUtils.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/jackrabbit/authorization/AccessControlUtils.java?rev=1432146&r1=1432145&r2=1432146&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/jackrabbit/authorization/AccessControlUtils.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/jackrabbit/authorization/AccessControlUtils.java
Fri Jan 11 16:43:31 2013
@@ -47,10 +47,22 @@ public class AccessControlUtils {
      * contains an unknown/invalid privilege name.
      */
     public static Privilege[] privilegesFromNames(Session session, String... privilegeNames)
throws RepositoryException {
-        AccessControlManager acMgr = session.getAccessControlManager();
+        return privilegesFromNames(session.getAccessControlManager(), privilegeNames);
+    }
+
+    /**
+     * Retrieves the {@link Privilege}s from the specified privilege names.
+     *
+     * @param accessControlManager The access control manager.
+     * @param privilegeNames The privilege names.
+     * @return An array of privileges.
+     * @throws RepositoryException If an error occurs or if {@code privilegeNames}
+     * contains an unknown/invalid privilege name.
+     */
+    public static Privilege[] privilegesFromNames(AccessControlManager accessControlManager,
String... privilegeNames) throws RepositoryException {
         Set<Privilege> privileges = new HashSet<Privilege>(privilegeNames.length);
         for (String privName : privilegeNames) {
-            privileges.add(acMgr.privilegeFromName(privName));
+            privileges.add(accessControlManager.privilegeFromName(privName));
         }
         return privileges.toArray(new Privilege[privileges.size()]);
     }



Mime
View raw message