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

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


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

  Modified:    src/main/org/jboss/web/tomcat/security  JBossWebRealm.java
  Log:
  JBAS-3373: Use the Resource Keys
  
  Revision  Changes    Path
  1.2       +18 -17    jboss-tomcat/src/main/org/jboss/web/tomcat/security/JBossWebRealm.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: JBossWebRealm.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-tomcat/src/main/org/jboss/web/tomcat/security/JBossWebRealm.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- JBossWebRealm.java	11 Jul 2006 17:45:26 -0000	1.1
  +++ JBossWebRealm.java	17 Jul 2006 17:23:19 -0000	1.2
  @@ -63,10 +63,11 @@
   import org.jboss.security.auth.certs.SubjectDNMapping;
   import org.jboss.security.authorization.AuthorizationContext;
   import org.jboss.security.authorization.AuthorizationException;
  +import org.jboss.security.authorization.ResourceKeys;
   import org.jboss.security.plugins.AuthorizationManagerServiceMBean;
   import org.jboss.web.tomcat.security.authorization.WebResource;
   
  -//$Id: JBossWebRealm.java,v 1.1 2006/07/11 17:45:26 asaldhana Exp $
  +//$Id: JBossWebRealm.java,v 1.2 2006/07/17 17:23:19 asaldhana Exp $
   
   /**
    *  Implementation of the Tomcat Realm Interface.
  @@ -76,7 +77,7 @@
    *  subcontext to access the security manager interfaces for authentication. 
    *  @author <a href="mailto:Anil.Saldhana at jboss.org">Anil Saldhana</a>
    *  @since  Jul 10, 2006 
  - *  @version $Revision: 1.1 $
  + *  @version $Revision: 1.2 $
    */
   public class JBossWebRealm extends RealmBase  
   {  
  @@ -427,12 +428,12 @@
         Subject caller = this.establishSubjectContext(request.getPrincipal());
   
         Map map =  new HashMap(); 
  -      map.put("catalina.request", request);
  -      map.put("catalina.response", response);
  -      map.put("catalina.constraints", securityConstraints);
  -      map.put("catalina.context", context); 
  -      map.put("authenticated.subject", caller);  
  -      map.put("resourcePermissionCheck", Boolean.TRUE); 
  +      map.put(ResourceKeys.WEB_REQUEST, request);
  +      map.put(ResourceKeys.WEB_RESPONSE, response);
  +      map.put(ResourceKeys.WEB_SECURITY_CONSTRAINTS, securityConstraints);
  +      map.put(ResourceKeys.WEB_CONTEXT, context); 
  +      map.put(ResourceKeys.CALLER_SUBJECT, caller);  
  +      map.put(ResourceKeys.RESOURCE_PERM_CHECK, Boolean.TRUE); 
         int permit = authorize(map);
         boolean authzDecision = (permit == AuthorizationContext.PERMIT);
         boolean finalDecision = baseDecision && authzDecision; 
  @@ -487,11 +488,11 @@
          
         boolean baseDecision = super.hasRole(principal, role); 
         Map map =  new HashMap(); 
  -      map.put("roleName", roleName);
  -      map.put("hasRole.Principal", principal);
  -      map.put("roleRefPermissionCheck", Boolean.TRUE); 
  -      map.put("servletName", servletName);
  -      map.put("principal.roles", this.getPrincipalRoles(principal));
  +      map.put(ResourceKeys.ROLENAME, roleName);
  +      map.put(ResourceKeys.HASROLE_PRINCIPAL, principal);
  +      map.put(ResourceKeys.ROLEREF_PERM_CHECK, Boolean.TRUE); 
  +      map.put(ResourceKeys.SERVLET_NAME, servletName);
  +      map.put(ResourceKeys.PRINCIPAL_ROLES, this.getPrincipalRoles(principal));
         int permit = authorize(map);
         boolean authzDecision = (permit == AuthorizationContext.PERMIT);
         boolean finalDecision = baseDecision && authzDecision; 
  @@ -511,10 +512,10 @@
         Principal requestPrincipal = request.getPrincipal();
         establishSubjectContext(requestPrincipal); 
         Map map = new HashMap(); 
  -      map.put("catalina.request", request);
  -      map.put("catalina.response", response);
  -      map.put("catalina.constraints", constraints); 
  -      map.put("userDataPermissionCheck", Boolean.TRUE); 
  +      map.put(ResourceKeys.WEB_REQUEST, request);
  +      map.put(ResourceKeys.WEB_RESPONSE, response);
  +      map.put(ResourceKeys.WEB_SECURITY_CONSTRAINTS, constraints); 
  +      map.put(ResourceKeys.USERDATA_PERM_CHECK, Boolean.TRUE); 
         int permit = authorize(map);
         boolean ok = (permit == AuthorizationContext.PERMIT); 
         
  
  
  



More information about the jboss-cvs-commits mailing list