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

Shane Bryzak Shane_Bryzak at symantec.com
Fri Jan 12 00:35:11 EST 2007


  User: sbryzak2
  Date: 07/01/12 00:35:11

  Modified:    src/main/org/jboss/seam/interceptors 
                        SecurityInterceptor.java
  Log:
  throw more specific exceptions
  
  Revision  Changes    Path
  1.18      +6 -3      jboss-seam/src/main/org/jboss/seam/interceptors/SecurityInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SecurityInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/interceptors/SecurityInterceptor.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -b -r1.17 -r1.18
  --- SecurityInterceptor.java	9 Jan 2007 11:50:37 -0000	1.17
  +++ SecurityInterceptor.java	12 Jan 2007 05:35:11 -0000	1.18
  @@ -6,7 +6,9 @@
   import org.jboss.seam.annotations.Interceptor;
   import org.jboss.seam.annotations.security.Restrict;
   import org.jboss.seam.intercept.InvocationContext;
  +import org.jboss.seam.security.AuthorizationException;
   import org.jboss.seam.security.Identity;
  +import org.jboss.seam.security.NotLoggedInException;
   import org.jboss.seam.security.SeamSecurityManager;
   
   /**
  @@ -14,7 +16,8 @@
    * 
    * @author Shane Bryzak
    */
  - at Interceptor(stateless = true, around = ValidationInterceptor.class, within = BijectionInterceptor.class)
  + at Interceptor(stateless = true, around = ValidationInterceptor.class, 
  +         within = {BijectionInterceptor.class, ExceptionInterceptor.class})
   public class SecurityInterceptor extends AbstractInterceptor
   {
      private static final long serialVersionUID = -6567750187000766925L;
  @@ -34,10 +37,10 @@
         if (r != null)
         {
            if (!Identity.instance().isLoggedIn())
  -            throw new SecurityException("Not logged in");
  +            throw new NotLoggedInException();
            
            if (!SeamSecurityManager.instance().evaluateExpression(r.value()))
  -            throw new SecurityException(String.format(
  +            throw new AuthorizationException(String.format(
                     "Authorization check failed for expression [%s]", r.value()));
         }
   
  
  
  



More information about the jboss-cvs-commits mailing list