[jboss-cvs] jboss-tomcat/src/main/org/jboss/web/tomcat/security/authorization/delegates ...

Anil Saldhana anil.saldhana at jboss.com
Mon Jul 17 13:23:50 EDT 2006


  User: asaldhana
  Date: 06/07/17 13:23:50

  Modified:    src/main/org/jboss/web/tomcat/security/authorization/delegates 
                        WebJACCPolicyModuleDelegate.java
  Log:
  JBAS-3373: Use the Resource Keys
  
  Revision  Changes    Path
  1.2       +16 -14    jboss-tomcat/src/main/org/jboss/web/tomcat/security/authorization/delegates/WebJACCPolicyModuleDelegate.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: WebJACCPolicyModuleDelegate.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-tomcat/src/main/org/jboss/web/tomcat/security/authorization/delegates/WebJACCPolicyModuleDelegate.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- WebJACCPolicyModuleDelegate.java	11 Jul 2006 17:46:29 -0000	1.1
  +++ WebJACCPolicyModuleDelegate.java	17 Jul 2006 17:23:50 -0000	1.2
  @@ -44,18 +44,19 @@
   import org.jboss.security.authorization.AuthorizationContext;
   import org.jboss.security.authorization.PolicyRegistration;
   import org.jboss.security.authorization.Resource;
  +import org.jboss.security.authorization.ResourceKeys;
   import org.jboss.security.authorization.modules.AuthorizationModuleHelper;
   import org.jboss.web.tomcat.security.JaccContextValve;
   
   
  -//$Id: WebJACCPolicyModuleDelegate.java,v 1.1 2006/07/11 17:46:29 asaldhana Exp $
  +//$Id: WebJACCPolicyModuleDelegate.java,v 1.2 2006/07/17 17:23:50 asaldhana Exp $
   
   /**
    *  JACC based authorization module helper that deals with the web layer 
    *  authorization decisions
    *  @author <a href="mailto:Anil.Saldhana at jboss.org">Anil Saldhana</a>
    *  @since  July 7, 2006 
  - *  @version $Revision: 1.1 $
  + *  @version $Revision: 1.2 $
    */
   public class WebJACCPolicyModuleDelegate extends AuthorizationModuleHelper
   {   
  @@ -80,19 +81,20 @@
         if(map.size() == 0)
            throw new IllegalStateException("Map from the Resource is size zero");
         //Get the Catalina Request Object
  -      Request request = (Request)map.get("catalina.request");
  -      Response response = (Response)map.get("catalina.response");
  -      SecurityConstraint[] constraints = (SecurityConstraint[])map.get("catalina.constraints");
  -      Context context = (Context)map.get("catalina.context"); 
  +      Request request = (Request)map.get(ResourceKeys.WEB_REQUEST);
  +      Response response = (Response)map.get(ResourceKeys.WEB_RESPONSE);
  +      SecurityConstraint[] constraints = (SecurityConstraint[])
  +                                    map.get(ResourceKeys.WEB_SECURITY_CONSTRAINTS);
  +      Context context = (Context)map.get(ResourceKeys.WEB_CONTEXT); 
         //Obtained by establishing subject context
  -      Subject callerSubject = (Subject)map.get("authenticated.subject"); 
  -      String roleName = (String)map.get("roleName");
  -      Principal principal = (Principal)map.get("hasRole.Principal");
  -      Set roles = (Set)map.get("principal.roles"); 
  -      String servletName = (String)map.get("servletName");
  -      Boolean resourceCheck = checkBooleanValue((Boolean)map.get("resourcePermissionCheck"));
  -      Boolean userDataCheck = checkBooleanValue((Boolean)map.get("userDataPermissionCheck"));
  -      Boolean roleRefCheck = checkBooleanValue((Boolean)map.get("roleRefPermissionCheck")); 
  +      Subject callerSubject = (Subject)map.get(ResourceKeys.CALLER_SUBJECT); 
  +      String roleName = (String)map.get(ResourceKeys.ROLENAME);
  +      Principal principal = (Principal)map.get(ResourceKeys.HASROLE_PRINCIPAL);
  +      Set roles = (Set)map.get(ResourceKeys.PRINCIPAL_ROLES); 
  +      String servletName = (String)map.get(ResourceKeys.SERVLET_NAME);
  +      Boolean resourceCheck = checkBooleanValue((Boolean)map.get(ResourceKeys.RESOURCE_PERM_CHECK));
  +      Boolean userDataCheck = checkBooleanValue((Boolean)map.get(ResourceKeys.USERDATA_PERM_CHECK));
  +      Boolean roleRefCheck = checkBooleanValue((Boolean)map.get(ResourceKeys.ROLEREF_PERM_CHECK)); 
         
         validatePermissionChecks(resourceCheck,userDataCheck,roleRefCheck);
         
  
  
  



More information about the jboss-cvs-commits mailing list