From: <jbo...@li...> - 2006-05-24 22:18:44
|
Author: soh...@jb... Date: 2006-05-24 18:18:41 -0400 (Wed, 24 May 2006) New Revision: 4409 Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/auth/ACLTagHandler.java labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationListener.java Log: Logic fix for when a security provider is not hooked in Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/auth/ACLTagHandler.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/auth/ACLTagHandler.java 2006-05-24 18:35:03 UTC (rev 4408) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/auth/ACLTagHandler.java 2006-05-24 22:18:41 UTC (rev 4409) @@ -89,13 +89,13 @@ FacesContext facesContext = ctx.getFacesContext(); //make sure an authorization provider has been hooked in + boolean skipAuth = false; try { if(Authorization.getProvider()==null) { //no authorization will be enforced - this.nextHandler.apply(ctx, parent); - return; + skipAuth = true; } } catch(Exception e) @@ -103,6 +103,12 @@ throw new FacesException(e); } + if(skipAuth) + { + this.nextHandler.apply(ctx, parent); + return; + } + //an authorization provider is hooked in....go ahead and perform authorization try { Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationListener.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationListener.java 2006-05-24 18:35:03 UTC (rev 4408) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/auth/AuthorizationListener.java 2006-05-24 22:18:41 UTC (rev 4409) @@ -65,13 +65,12 @@ FacesContext facesContext = FacesContext.getCurrentInstance(); //make sure an authorization provider has been hooked in + boolean skipAuth = false; try { if(Authorization.getProvider()==null) { - //no authorization will be enforced - super.processAction(actionEvent); - return; + skipAuth = true; } } catch(Exception e) @@ -79,7 +78,14 @@ throw new FacesException("Error calling action method of component with id " + actionEvent.getComponent().getClientId(facesContext), e); } + if(skipAuth) + { + //no authorization will be enforced + super.processAction(actionEvent); + return; + } + //an authorization provider is hooked in, go ahead and enforce authorization boolean isAccessAllowed = this.isAccessAllowed(actionEvent); |