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

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri May 2 19:35:59 EDT 2008


Author: shane.bryzak at jboss.com
Date: 2008-05-02 19:35:59 -0400 (Fri, 02 May 2008)
New Revision: 8101

Modified:
   trunk/src/main/org/jboss/seam/security/permission/RoleCheck.java
   trunk/src/main/org/jboss/seam/security/permission/RuleBasedPermissionResolver.java
Log:
minor

Modified: trunk/src/main/org/jboss/seam/security/permission/RoleCheck.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/permission/RoleCheck.java	2008-05-02 19:04:45 UTC (rev 8100)
+++ trunk/src/main/org/jboss/seam/security/permission/RoleCheck.java	2008-05-02 23:35:59 UTC (rev 8101)
@@ -31,4 +31,9 @@
    {
       this.granted = false;
    }
+   
+   public String getName()
+   {
+      return name;
+   }
 }

Modified: trunk/src/main/org/jboss/seam/security/permission/RuleBasedPermissionResolver.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/permission/RuleBasedPermissionResolver.java	2008-05-02 19:04:45 UTC (rev 8100)
+++ trunk/src/main/org/jboss/seam/security/permission/RuleBasedPermissionResolver.java	2008-05-02 23:35:59 UTC (rev 8101)
@@ -77,15 +77,6 @@
                   RULES_COMPONENT_NAME + "' if permission checks are required.");
       }
    }
-
-   @Observer(Identity.EVENT_POST_AUTHENTICATE)
-   public void postAuthenticate()
-   {
-      if (getSecurityContext() != null)
-      {         
-         getSecurityContext().insert(Identity.instance().getPrincipal());
-      }
-   }
    
    /**
     * Performs a permission check for the specified name and action
@@ -286,16 +277,22 @@
    }
    
    /**
-    * If we were authenticated with the JpaIdentityStore, then insert the authenticated
-    * UserAccount into the security context.
+    * Post-authentication event observer
     */
    @Observer(Identity.EVENT_POST_AUTHENTICATE)
    public void setUserAccountInSecurityContext()
    {
-      if (Contexts.isEventContextActive() && Contexts.isSessionContextActive() &&
-            Contexts.getEventContext().isSet(JpaIdentityStore.AUTHENTICATED_USER))
-      {
-         getSecurityContext().insert(Contexts.getEventContext().get(JpaIdentityStore.AUTHENTICATED_USER));
+      if (getSecurityContext() != null)
+      {         
+         getSecurityContext().insert(Identity.instance().getPrincipal());
+
+         // If we were authenticated with the JpaIdentityStore, then insert the authenticated
+         // UserAccount into the security context.         
+         if (Contexts.isEventContextActive() && Contexts.isSessionContextActive() &&
+               Contexts.getEventContext().isSet(JpaIdentityStore.AUTHENTICATED_USER))
+         {
+            getSecurityContext().insert(Contexts.getEventContext().get(JpaIdentityStore.AUTHENTICATED_USER));
+         }
       }
    }
 }




More information about the seam-commits mailing list