[jboss-cvs] jboss-seam/src/main/org/jboss/seam/security ...

Gavin King gavin.king at jboss.com
Wed Feb 7 12:12:31 EST 2007


  User: gavin   
  Date: 07/02/07 12:12:31

  Modified:    src/main/org/jboss/seam/security  Identity.java
  Log:
  JBSEAM-773 login redirects
  
  Revision  Changes    Path
  1.53      +20 -3     jboss-seam/src/main/org/jboss/seam/security/Identity.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Identity.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/security/Identity.java,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -b -r1.52 -r1.53
  --- Identity.java	6 Feb 2007 16:27:03 -0000	1.52
  +++ Identity.java	7 Feb 2007 17:12:31 -0000	1.53
  @@ -165,6 +165,7 @@
         {
            if ( !isLoggedIn() )
            {
  +            Events.instance().raiseEvent("org.jboss.seam.notLoggedIn");
               throw new NotLoggedInException(String.format(
                  "Error evaluating expression [%s] - User not logged in", expr));
            }
  @@ -413,10 +414,18 @@
      {
         if ( !hasRole(role) )
         {
  +         if ( !isLoggedIn() )
  +         {
  +            Events.instance().raiseEvent("org.jboss.seam.notLoggedIn");
  +            throw new NotLoggedInException();
  +         }
  +         else
  +         {
            throw new AuthorizationException(String.format(
                     "Authorization check failed for role [%s]", role));
         }
      }
  +   }
   
      /**
       * Assert that the current authenticated Identity has permission for
  @@ -431,10 +440,18 @@
      {
         if ( !hasPermission(name, action, arg) )
         {
  +         if ( !isLoggedIn() )
  +         {
  +            Events.instance().raiseEvent("org.jboss.seam.notLoggedIn");
  +            throw new NotLoggedInException();
  +         }
  +         else
  +         {
            throw new AuthorizationException(String.format(
                     "Authorization check failed for permission [%s,%s]", name, action));
         }
      }
  +   }
   
      /**
       * Performs a permission check for the specified name and action
  
  
  



More information about the jboss-cvs-commits mailing list