lenya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andr...@apache.org
Subject cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting AccessControlAction.java
Date Tue, 05 Aug 2003 16:26:48 GMT
andreas     2003/08/05 09:26:48

  Modified:    src/java/org/apache/lenya/cms/cocoon/acting
                        AccessControlAction.java
  Log:
  simplified authorizer interface
  
  Revision  Changes    Path
  1.3       +12 -16    cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/AccessControlAction.java
  
  Index: AccessControlAction.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/AccessControlAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AccessControlAction.java	17 Jul 2003 16:24:18 -0000	1.2
  +++ AccessControlAction.java	5 Aug 2003 16:26:48 -0000	1.3
  @@ -68,14 +68,13 @@
   import org.apache.cocoon.environment.SourceResolver;
   import org.apache.lenya.cms.ac2.AccessController;
   import org.apache.lenya.cms.ac2.AccessControllerResolver;
  +import org.apache.lenya.util.ServletHelper;
   
   /**
    * @author <a href="mailto:andreas@apache.org">Andreas Hartmann</a>
    */
   public abstract class AccessControlAction extends ConfigurableComposerAction {
   
  -    protected static final String DEFAULT_RESOLVER = "composable";
  -
       private AccessController accessController;
   
       /**
  @@ -101,26 +100,22 @@
           accessController = null;
   
           Request request = ObjectModelHelper.getRequest(objectModel);
  -        
  +
           Map result = null;
   
           try {
               selector =
                   (ComponentSelector) manager.lookup(AccessControllerResolver.ROLE + "Selector");
  -            resolver = (AccessControllerResolver) selector.select(DEFAULT_RESOLVER);
  +            resolver =
  +                (AccessControllerResolver) selector.select(
  +                    AccessControllerResolver.DEFAULT_RESOLVER);
  +
  +            String webappUrl = ServletHelper.getWebappURI(request);
  +            accessController = resolver.resolveAccessController(webappUrl);
   
  -            String requestURI = request.getRequestURI();
  -            String context = request.getContextPath();
  -            if (context == null) {
  -                context = "";
  -            }
  -            String url = requestURI.substring(context.length());
  -            accessController = resolver.resolveAccessController(url);
  -            
               if (accessController == null) {
                   result = Collections.EMPTY_MAP;
  -            }
  -            else {
  +            } else {
                   result = doAct(redirector, sourceResolver, objectModel, source, parameters);
               }
   
  @@ -162,7 +157,8 @@
           SourceResolver resolver,
           Map objectModel,
           String source,
  -        Parameters parameters) throws Exception;
  +        Parameters parameters)
  +        throws Exception;
   
       /**
        * Returns the access controller.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org


Mime
View raw message