[jboss-cvs] JBossAS SVN: r80918 - projects/security/security-jboss-sx/trunk/jbosssx/src/main/java/org/jboss/security/jacc.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Nov 13 01:42:46 EST 2008


Author: anil.saldhana at jboss.com
Date: 2008-11-13 01:42:46 -0500 (Thu, 13 Nov 2008)
New Revision: 80918

Modified:
   projects/security/security-jboss-sx/trunk/jbosssx/src/main/java/org/jboss/security/jacc/DelegatingPolicy.java
Log:
SECURITY-322: merge the policy delegate perms with the context policy perms

Modified: projects/security/security-jboss-sx/trunk/jbosssx/src/main/java/org/jboss/security/jacc/DelegatingPolicy.java
===================================================================
--- projects/security/security-jboss-sx/trunk/jbosssx/src/main/java/org/jboss/security/jacc/DelegatingPolicy.java	2008-11-13 04:57:59 UTC (rev 80917)
+++ projects/security/security-jboss-sx/trunk/jbosssx/src/main/java/org/jboss/security/jacc/DelegatingPolicy.java	2008-11-13 06:42:46 UTC (rev 80918)
@@ -200,11 +200,8 @@
     * Return the permission collection associated with the cs.
     * If there is no active JACC PolicyContext then the delegate value for 
     * getPermissions(CodeSource) is returned. Otherwise the JACC policy context
-    * permissions are returned.
+    * permissions are returned. 
     * 
-    * @todo We should probably merge the PolicyContext permissions with the
-    * delegate permission?
-    * 
     * @param cs - the CodeSource  
     * @return the associated permission collection
     */ 
@@ -222,6 +219,11 @@
          if (policy != null)
          {
             pc = policy.getPermissions();
+            PermissionCollection delegatePerms = delegate.getPermissions(cs);
+            for(Enumeration<Permission> e = delegatePerms.elements();e.hasMoreElements();)
+            {
+               pc.add(e.nextElement());
+            } 
          }
          else
          {
@@ -230,6 +232,8 @@
       }
       return pc;
    }
+   
+   
 
    /**
     * We dynamically manage the active policies on commit so refresh is a noop.
@@ -392,7 +396,7 @@
       if( policy != null )
          policy.delete();
    }
-
+   
    void removeExcludedPolicy(String contextID)
       throws PolicyContextException
    {




More information about the jboss-cvs-commits mailing list