portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r414773 - /portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/impl/PermissionManagerImpl.java
Date Fri, 16 Jun 2006 07:58:34 GMT
Author: ate
Date: Fri Jun 16 00:58:34 2006
New Revision: 414773

URL: http://svn.apache.org/viewvc?rev=414773&view=rev
Log:
Clearing permissionsCache when granting, revoking or removing permissions to make sure the
ThreadLocal cache isn't out-of-sync

Modified:
    portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/impl/PermissionManagerImpl.java

Modified: portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/impl/PermissionManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/impl/PermissionManagerImpl.java?rev=414773&r1=414772&r2=414773&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/impl/PermissionManagerImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/impl/PermissionManagerImpl.java
Fri Jun 16 00:58:34 2006
@@ -132,7 +132,6 @@
         if ((null != principalsFullPath) && principalsFullPath.size() > 0)
         {
             HashSet permissionsSet = new HashSet();
-            ArrayList newPrincipals = new ArrayList();
             HashMap permissionsMap = (HashMap)permissionsCache.get();
             if (permissionsMap == null)
             {
@@ -281,6 +280,8 @@
         InternalPermission internalPermission = getInternalPermission(permission);
         if (null != internalPermission)
         {
+            // clear the whole ThreadLocal permissions cache
+            permissionsCache.set(null);
             try
             {
                 // Remove permission.
@@ -314,6 +315,8 @@
             {
                 internalPermissions.clear();
             }
+            // clear the whole ThreadLocal permissions cache
+            permissionsCache.set(null);
             try
             {
                 internalPrincipal.setModifiedDate(new Timestamp(System.currentTimeMillis()));
@@ -371,6 +374,8 @@
         {
             internalPermissions.add(internalPermission);
         }
+        // clear the whole ThreadLocal permissions cache
+        permissionsCache.set(null);
         try
         {
             internalPrincipal.setModifiedDate(new Timestamp(System.currentTimeMillis()));
@@ -437,6 +442,8 @@
                 }
                 if (revokePermission)
                 {
+                    // clear the whole ThreadLocal permissions cache
+                    permissionsCache.set(null);
                     try
                     {
                         internalPrincipal.setModifiedDate(new Timestamp(System.currentTimeMillis()));



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message