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, 12 Aug 2003 15:17:52 GMT
andreas     2003/08/12 08:17:52

  Modified:    src/java/org/apache/lenya/cms/cocoon/components/modules/input
                        AccessControlModule.java
               src/java/org/apache/lenya/cms/cocoon/acting
                        AccessControlAction.java
  Log:
  using DEFAULT_RESOLVER from AccessControllerResolver
  
  Revision  Changes    Path
  1.7       +10 -25    cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/components/modules/input/AccessControlModule.java
  
  Index: AccessControlModule.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/components/modules/input/AccessControlModule.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AccessControlModule.java	7 Aug 2003 14:03:23 -0000	1.6
  +++ AccessControlModule.java	12 Aug 2003 15:17:52 -0000	1.7
  @@ -82,9 +82,7 @@
    * @author egli
    * 
    */
  -public class AccessControlModule
  -    extends AbstractInputModule
  -    implements Serviceable {
  +public class AccessControlModule extends AbstractInputModule implements Serviceable {
   
       public static final String USER_ID = "user-id";
       public static final String USER_NAME = "user-name";
  @@ -112,10 +110,7 @@
        *
        * @see org.apache.cocoon.components.modules.input.InputModule#getAttribute(java.lang.String,
org.apache.avalon.framework.configuration.Configuration, java.util.Map)
        */
  -    public Object getAttribute(
  -        String name,
  -        Configuration modeConf,
  -        Map objectModel)
  +    public Object getAttribute(String name, Configuration modeConf, Map objectModel)
           throws ConfigurationException {
   
           Request request = ObjectModelHelper.getRequest(objectModel);
  @@ -123,8 +118,7 @@
           Object value = null;
   
           if (session != null) {
  -            Identity identity =
  -                (Identity) session.getAttribute(Identity.class.getName());
  +            Identity identity = (Identity) session.getAttribute(Identity.class.getName());
               if (identity != null) {
   
                   if (name.equals(USER_ID)) {
  @@ -158,18 +152,13 @@
       /**
        * @see org.apache.cocoon.components.modules.input.InputModule#getAttributeValues(java.lang.String,
org.apache.avalon.framework.configuration.Configuration, java.util.Map)
        */
  -    public Object[] getAttributeValues(
  -        String name,
  -        Configuration modeConf,
  -        Map objectModel)
  +    public Object[] getAttributeValues(String name, Configuration modeConf, Map objectModel)
           throws ConfigurationException {
           Object[] objects = { getAttribute(name, modeConf, objectModel)};
   
           return objects;
       }
   
  -    protected static final String DEFAULT_RESOLVER = "composable";
  -
       /**
        * Returns the item manager for a certain name.
        * @param request The request.
  @@ -186,11 +175,10 @@
           ItemManager itemManager = null;
   
           try {
  -            selector =
  -                (ServiceSelector) manager.lookup(
  -                    AccessControllerResolver.ROLE + "Selector");
  +            selector = (ServiceSelector) manager.lookup(AccessControllerResolver.ROLE +
"Selector");
               resolver =
  -                (AccessControllerResolver) selector.select(DEFAULT_RESOLVER);
  +                (AccessControllerResolver) selector.select(
  +                    AccessControllerResolver.DEFAULT_RESOLVER);
   
               String requestURI = request.getRequestURI();
               String context = request.getContextPath();
  @@ -201,8 +189,7 @@
               accessController = resolver.resolveAccessController(url);
   
               AccreditableManager accreditableManager =
  -                ((DefaultAccessController) accessController)
  -                    .getAccreditableManager();
  +                ((DefaultAccessController) accessController).getAccreditableManager();
   
               if (name.equals(USER_MANAGER)) {
                   itemManager = accreditableManager.getUserManager();
  @@ -215,9 +202,7 @@
               }
   
           } catch (Exception e) {
  -            throw new ConfigurationException(
  -                "Obtaining item manager failed: ",
  -                e);
  +            throw new ConfigurationException("Obtaining item manager failed: ", e);
           } finally {
               if (selector != null) {
                   if (resolver != null) {
  
  
  
  1.5       +4 -1      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AccessControlAction.java	7 Aug 2003 13:19:01 -0000	1.4
  +++ AccessControlAction.java	12 Aug 2003 15:17:52 -0000	1.5
  @@ -106,9 +106,12 @@
           try {
               selector =
                   (ComponentSelector) manager.lookup(AccessControllerResolver.ROLE + "Selector");
  +                
  +            getLogger().debug("Resolving AC resolver for type [" + AccessControllerResolver.DEFAULT_RESOLVER
+ "]");
               resolver =
                   (AccessControllerResolver) selector.select(
                       AccessControllerResolver.DEFAULT_RESOLVER);
  +            getLogger().debug("Resolved AC resolver [" + resolver + "]");
   
               String webappUrl = ServletHelper.getWebappURI(request);
               accessController = resolver.resolveAccessController(webappUrl);
  
  
  

---------------------------------------------------------------------
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