ozeigermann    2004/12/07 06:10:06

  Modified:    src/share/org/apache/slide/macro MacroImpl.java
  Log:
  Resource now is copied before permissions.,
  
  Fixed bug that did not allow to copy a read-only file.
  
  Patch contributed by Honor� David N. in
  http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&msgNo=14760
  
  Revision  Changes    Path
  1.51      +29 -29    
jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java
  
  Index: MacroImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- MacroImpl.java    8 Nov 2004 09:22:56 -0000       1.50
  +++ MacroImpl.java    7 Dec 2004 14:10:06 -0000       1.51
  @@ -813,31 +813,6 @@
                   }
               }
               
  -            // Trying to recreate permissions
  -            try {
  -                
  -                Enumeration sourcePermissions = securityHelper
  -                    .enumeratePermissions(token, sourceNode);
  -                
  -                while (sourcePermissions.hasMoreElements()) {
  -                    NodePermission permission =
  -                        (NodePermission) sourcePermissions.nextElement();
  -                    NodePermission newPermission =
  -                        new NodePermission(destinationUri,
  -                                           permission.getSubjectUri(),
  -                                           permission.getActionUri(),
  -                                           permission.isInheritable(),
  -                                           permission.isNegative());
  -                    securityHelper.grantPermission(token, newPermission);
  -                }
  -                
  -            } catch (AccessDeniedException ex) {
  -                // Means that we don't have modifyPermissions rights
  -                // (root access) on the target.
  -                // The copy should definitely succeed anyway,
  -                // so we silently catch the exception.
  -            }
  -            
               // Now copying revision descriptors and content
               NodeRevisionDescriptors sourceNrds =
                   contentHelper.retrieve(token, sourceNode.getUri());
  @@ -883,6 +858,31 @@
                   }
               }
               
  +            // Trying to recreate permissions
  +            try {
  +                
  +                Enumeration sourcePermissions = securityHelper
  +                    .enumeratePermissions(token, sourceNode);
  +                
  +                while (sourcePermissions.hasMoreElements()) {
  +                    NodePermission permission =
  +                        (NodePermission) sourcePermissions.nextElement();
  +                    NodePermission newPermission =
  +                        new NodePermission(destinationUri,
  +                                           permission.getSubjectUri(),
  +                                           permission.getActionUri(),
  +                                           permission.isInheritable(),
  +                                           permission.isNegative());
  +                    securityHelper.grantPermission(token, newPermission);
  +                }
  +                
  +            } catch (AccessDeniedException ex) {
  +                // Means that we don't have modifyPermissions rights
  +                // (root access) on the target.
  +                // The copy should definitely succeed anyway,
  +                // so we silently catch the exception.
  +            }
  +              
           } catch(SlideException ex) {
               // ex.printStackTrace(); //the exception is packed and
               // (hopefully) reported in the response
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to