[seam-commits] Seam SVN: r8829 - trunk/src/main/org/jboss/seam/security.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Aug 27 08:20:29 EDT 2008


Author: shane.bryzak at jboss.com
Date: 2008-08-27 08:20:29 -0400 (Wed, 27 Aug 2008)
New Revision: 8829

Modified:
   trunk/src/main/org/jboss/seam/security/Identity.java
   trunk/src/main/org/jboss/seam/security/RunAsOperation.java
Log:
JBSEAM-3224

Modified: trunk/src/main/org/jboss/seam/security/Identity.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/Identity.java	2008-08-27 09:35:03 UTC (rev 8828)
+++ trunk/src/main/org/jboss/seam/security/Identity.java	2008-08-27 12:20:29 UTC (rev 8829)
@@ -78,7 +78,7 @@
    
    private RememberMe rememberMe;
    
-   private boolean systemOp;
+   private ThreadLocal<Boolean> systemOp = new ThreadLocal<Boolean>();
    
    private String jaasConfigName = null;
    
@@ -412,7 +412,7 @@
    public boolean hasRole(String role)
    {
       if (!securityEnabled) return true;
-      if (systemOp) return true;
+      if (systemOp.get()) return true;
       
       isLoggedIn(true);
       
@@ -524,7 +524,7 @@
     */
    public void checkPermission(String name, String action, Object...arg)
    {
-      if (systemOp) return; 
+      if (systemOp.get()) return; 
       
       isLoggedIn(true);
       
@@ -546,7 +546,7 @@
    
    public void checkPermission(Object target, String action)
    {
-      if (systemOp) return;
+      if (systemOp.get()) return;
       
       isLoggedIn(true);
       
@@ -577,7 +577,7 @@
    public boolean hasPermission(String name, String action, Object...arg)
    {      
       if (!securityEnabled) return true;
-      if (systemOp) return true;     
+      if (systemOp.get()) return true;     
       if (permissionMapper == null) return false;
          
       if (arg != null)
@@ -598,7 +598,7 @@
    public boolean hasPermission(Object target, String action)
    {
       if (!securityEnabled) return true;
-      if (systemOp) return true;      
+      if (systemOp.get()) return true;      
       if (permissionMapper == null) return false;
       if (target == null) return false;
       
@@ -706,13 +706,13 @@
          principal = operation.getPrincipal();
          subject = operation.getSubject();
          
-         systemOp = operation.isSystemOperation();
+         systemOp.set(operation.isSystemOperation());
          
          operation.execute();
       }
       finally
       {
-         systemOp = false;
+         systemOp.set(false);
          principal = savedPrincipal;
          subject = savedSubject;
       }

Modified: trunk/src/main/org/jboss/seam/security/RunAsOperation.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/RunAsOperation.java	2008-08-27 09:35:03 UTC (rev 8828)
+++ trunk/src/main/org/jboss/seam/security/RunAsOperation.java	2008-08-27 12:20:29 UTC (rev 8829)
@@ -37,7 +37,7 @@
    public RunAsOperation(boolean systemOp)
    {      
       this();
-      systemOp = true;
+      this.systemOp = systemOp;
    }
    
    public abstract void execute();




More information about the seam-commits mailing list