remm        01/07/11 10:18:15

  Modified:    src/share/org/apache/slide/structure StructureImpl.java
  Log:
  - Forgot to update store with the new role checking algorithm.
    Patch submitted by Christopher Lenz <cmlenz at gmx.de>
  
  Revision  Changes    Path
  1.21      +18 -12    
jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java
  
  Index: StructureImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- StructureImpl.java        2001/07/11 05:21:04     1.20
  +++ StructureImpl.java        2001/07/11 17:18:10     1.21
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java,v 1.20 
2001/07/11 05:21:04 remm Exp $
  - * $Revision: 1.20 $
  - * $Date: 2001/07/11 05:21:04 $
  + * $Header: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java,v 1.21 
2001/07/11 17:18:10 remm Exp $
  + * $Revision: 1.21 $
  + * $Date: 2001/07/11 17:18:10 $
    *
    * ====================================================================
    *
  @@ -78,7 +78,7 @@
    * Data helper class.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Remy Maucherat</a>
  - * @version $Revision: 1.20 $
  + * @version $Revision: 1.21 $
    */
   public final class StructureImpl implements Structure {
       
  @@ -598,14 +598,20 @@
           throws ServiceAccessException, ObjectNotFoundException,
           AccessDeniedException, LinkedObjectNotFoundException {
           
  -        // Checking role
  -        if (!securityHelper.hasRole(token, object.getClass().getName())) {
  -            // Allow the namespace admin to create roles he doesn't have
  -            Uri rootUri = namespace.getUri(token, "/");
  -            ObjectNode rootObject = rootUri.getStore().retrieveObject(rootUri);
  -            securityHelper.checkCredentials
  -                (token, rootObject,
  -                 namespaceConfig.getGrantPermissionAction());
  +        // Checking roles
  +        Enumeration roles = securityHelper.getRoles(object);
  +        while (roles.hasMoreElements()) {
  +            if (!securityHelper.hasRole(token, (String)roles.nextElement())) {
  +                // Allow only the namespace admin to create roles 
  +                // he doesn't have
  +                Uri rootUri = namespace.getUri(token, "/");
  +                ObjectNode rootObject =
  +                    rootUri.getStore().retrieveObject(rootUri);
  +                securityHelper.checkCredentials
  +                    (token, rootObject,
  +                     namespaceConfig.getGrantPermissionAction());
  +                break;
  +            }
           }
           
           ObjectNode realObject = retrieve(token, object.getUri(), false);
  
  
  

Reply via email to