svn commit: r563801 - /lenya/trunk/src/modules-core/usecase/java/src/org/apache/lenya/cms/ac/usecase/impl/UsecaseAuthorizerImpl.java

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Wed Aug  8 02:59:36 2007
New Revision: 563801

URL: http://svn.apache.org/viewvc?view=rev&rev=563801
Log:
UsecaseAuthorizerImpl: Removed unused code, updated javadocs

Modified:
    lenya/trunk/src/modules-core/usecase/java/src/org/apache/lenya/cms/ac/usecase/impl/UsecaseAuthorizerImpl.java

Modified: lenya/trunk/src/modules-core/usecase/java/src/org/apache/lenya/cms/ac/usecase/impl/UsecaseAuthorizerImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/usecase/java/src/org/apache/lenya/cms/ac/usecase/impl/UsecaseAuthorizerImpl.java?view=diff&rev=563801&r1=563800&r2=563801
==============================================================================
--- lenya/trunk/src/modules-core/usecase/java/src/org/apache/lenya/cms/ac/usecase/impl/UsecaseAuthorizerImpl.java (original)
+++ lenya/trunk/src/modules-core/usecase/java/src/org/apache/lenya/cms/ac/usecase/impl/UsecaseAuthorizerImpl.java Wed Aug  8 02:59:36 2007
@@ -35,7 +35,6 @@
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.cocoon.environment.Request;
-import org.apache.excalibur.source.SourceResolver;
 import org.apache.lenya.ac.AccessControlException;
 import org.apache.lenya.ac.Role;
 import org.apache.lenya.ac.cache.BuildException;
@@ -49,7 +48,15 @@
 
 /**
  * Authorizer for usecases.
- *
+ * <p>
+ * Supported parameters via {@link Parameterizable}:
+ * </p>
+ * <ul>
+ * <li>
+ *   {@link #PARAMETER_CONFIGURATION} - location of the usecase policies file
+ *   (parameterizable for testing purposes)
+ * </li>
+ * </ul>
  * @version $Id: UsecaseAuthorizer.java 392449 2006-04-07 23:20:38Z michi $
  */
 public class UsecaseAuthorizerImpl extends AbstractLogEnabled implements UsecaseAuthorizer,
@@ -71,7 +78,7 @@
     /**
      * Maps publication IDs to their configuration URIs.
      * This is a persistent map to avoid unnecessary publication lookups.
-     * Whenever an autorization request for a new publication is dealt with,
+     * Whenever an authorization request for a new publication is dealt with,
      * the publication's configuration URI is stored, to be re-used on later
      * occasions (for the lifetime of the component).
      */
@@ -170,19 +177,11 @@
             if (usecase != null) {
 
                 String _configurationUri;
-                // FIXME: this is not clear to me. please comment if you are familiar with this code...
-                // check if this component has a configurationURI. iiuc, that would have to be specified
-                // in the relevant patchfile, in this case
-                //     src/modules-core/usecase/config/cocoon-xconf/usecase-authorizer.xconf
-                // however, that file does not specify such a URI.
+                // Check if the service has been parameterized with a configuration URI. This
+                // can be used for testing purposes etc.
                 if (getConfigurationURI() != null) {
-                    // so this is never called. if it were, usecase permissions would break iiuc.
-                    // please clarify this.
                     _configurationUri = getConfigurationURI();
                 } else {
-                    // ok, here we get the usecase-permissions.xml of the current publication from
-                    // its access-control.xml configuration file.
-                    // this i understand.
                     Publication publication = PublicationUtil.getPublication(this.manager, request);
                     _configurationUri = getConfigurationURI(publication);
                 }
@@ -267,10 +266,6 @@
         }
     }
 
- 
-    /**
-     * @see org.apache.avalon.framework.parameters.Parameterizable#parameterize(org.apache.avalon.framework.parameters.Parameters)
-     */
     public void parameterize(Parameters parameters) throws ParameterException {
         if (parameters.isParameter(PARAMETER_CONFIGURATION)) {
             this.configurationUri = parameters.getParameter(PARAMETER_CONFIGURATION);
@@ -279,11 +274,6 @@
 
     private String getConfigurationURI() {
         return this.configurationUri;
-    }
-
-
-    private boolean authorize(Request request, String webappUrl) throws AccessControlException {
-        return authorize(request);
     }
 
     /**
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.