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

Shane Bryzak Shane_Bryzak at symantec.com
Sat Jan 27 06:29:59 EST 2007


  User: sbryzak2
  Date: 07/01/27 06:29:59

  Modified:    src/main/org/jboss/seam/security   Identity.java
                        NotLoggedInException.java
  Log:
  minor
  
  Revision  Changes    Path
  1.20      +21 -5     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.19
  retrieving revision 1.20
  diff -u -b -r1.19 -r1.20
  --- Identity.java	26 Jan 2007 06:38:29 -0000	1.19
  +++ Identity.java	27 Jan 2007 11:29:58 -0000	1.20
  @@ -82,7 +82,6 @@
      private String password;
      
      private MethodBinding authMethod;
  -   private String postLoginMethod;
   
      protected Principal principal;   
      protected Subject subject;
  @@ -166,15 +165,26 @@
       * Performs an authorization check, based on the specified security expression.
       * 
       * @param expr The security expression to evaluate
  -    * @throws NotLoggedInException Thrown if the user is not authenticated
  -    * @throws AuthorizationException if the authorization check fails
  +    * @throws NotLoggedInException Thrown if the authorization check fails and 
  +    * the user is not authenticated
  +    * @throws AuthorizationException Thrown if the authorization check fails and
  +    * the user is authenticated
       */
      public void checkRestriction(String expr)
      {      
         if (!evaluateExpression(expr))
  +      {
  +         if (!isLoggedIn())
  +         {
  +            throw new NotLoggedInException();
  +         }
  +         else
  +         {
            throw new AuthorizationException(String.format(
                  "Authorization check failed for expression [%s]", expr));      
      }
  +      }
  +   }
      
      public void login()
         throws LoginException
  @@ -195,12 +205,18 @@
         
         loginContext.login();
         
  +      password = null;
         postLogin();
      }
      
      public void logout()
      {
  +      username = null;
  +      password = null;
  +      principal = null;
  +      
         subject = new Subject();
  +      securityContext = securityRules.newWorkingMemory(false);
      }
   
      /**
  
  
  
  1.2       +1 -1      jboss-seam/src/main/org/jboss/seam/security/NotLoggedInException.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: NotLoggedInException.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/security/NotLoggedInException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  
  
  



More information about the jboss-cvs-commits mailing list