1 Reply Latest reply on Feb 13, 2007 3:14 PM by gavin.king

    Redirect to original page after AuthorizationException

    dilator

      Another event so we can redirect after a user has logged in as a user with sufficient privileges.

      public void checkRestriction(String expr)
       {
       if ( !evaluateExpression(expr) )
       {
       if ( !isLoggedIn() )
       {
       Events.instance().raiseEvent("org.jboss.seam.notLoggedIn");
       log.debug(String.format(
       "Error evaluating expression [%s] - User not logged in", expr));
       throw new NotLoggedInException();
       }
       else
       {
       Events.instance().raiseEvent("org.jboss.seam.notAuthorized");
       throw new AuthorizationException(String.format(
       "Authorization check failed for expression [%s]", expr));
       }
       }
       }
      


      Would do the job