You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by th...@apache.org on 2006/09/01 16:43:14 UTC

svn commit: r439339 - /lenya/sandbox/ac-restricted-1.4-src/modules-core/ac-impl/java/src/org/apache/lenya/ac/impl/DefaultPolicy.java

Author: thorsten
Date: Fri Sep  1 07:43:14 2006
New Revision: 439339

URL: http://svn.apache.org/viewvc?rev=439339&view=rev
Log:
Fixing bug that occured when removing an user. The problem was that the policy did not got updated that contained the accreditable because we did not updated the key matching

Modified:
    lenya/sandbox/ac-restricted-1.4-src/modules-core/ac-impl/java/src/org/apache/lenya/ac/impl/DefaultPolicy.java

Modified: lenya/sandbox/ac-restricted-1.4-src/modules-core/ac-impl/java/src/org/apache/lenya/ac/impl/DefaultPolicy.java
URL: http://svn.apache.org/viewvc/lenya/sandbox/ac-restricted-1.4-src/modules-core/ac-impl/java/src/org/apache/lenya/ac/impl/DefaultPolicy.java?rev=439339&r1=439338&r2=439339&view=diff
==============================================================================
--- lenya/sandbox/ac-restricted-1.4-src/modules-core/ac-impl/java/src/org/apache/lenya/ac/impl/DefaultPolicy.java (original)
+++ lenya/sandbox/ac-restricted-1.4-src/modules-core/ac-impl/java/src/org/apache/lenya/ac/impl/DefaultPolicy.java Fri Sep  1 07:43:14 2006
@@ -290,8 +290,15 @@
      */
     public void removeRoles(Accreditable accreditable)
             throws AccessControlException {
-        if (this.accreditableToCredential.containsKey(accreditable)) {
-            this.accreditableToCredential.remove(accreditable);
+        Credential[] credentials = getCredentials();
+        for (int credIndex = 0; credIndex < credentials.length; credIndex++) {
+            Credential credential = credentials[credIndex];
+            if (credential.getAccreditable().equals(accreditable)) {
+                String key = accreditable.toString()+KEY_SEPERATOR+credential.getRoles()[0];
+                if (this.accreditableToCredential.containsKey(key)) {
+                    this.accreditableToCredential.remove(key);
+                }
+            }
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org