ozeigermann    2004/10/27 08:43:12

  Modified:    src/share/org/apache/slide/structure Tag:
                        SLIDE_2_1_RELEASE_BRANCH StructureImpl.java
               src/webdav/server/org/apache/slide/webdav/util Tag:
                        SLIDE_2_1_RELEASE_BRANCH PropertyHelper.java
               src/share/org/apache/slide/security Tag:
                        SLIDE_2_1_RELEASE_BRANCH SecurityImpl.java
  Log:
  Applied patch for 31907 and 31908 contributed by Warwick Burrows
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.49.2.3  +6 -6      
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.49.2.2
  retrieving revision 1.49.2.3
  diff -u -r1.49.2.2 -r1.49.2.3
  --- StructureImpl.java        22 Sep 2004 14:43:42 -0000      1.49.2.2
  +++ StructureImpl.java        27 Oct 2004 15:43:11 -0000      1.49.2.3
  @@ -230,7 +230,7 @@
                       // Note : courUri still IS the Uri of the link, and so,
                       // in a way courUri is the parent of linkedUri.
                       Uri linkedUri = namespace
  -                        .getUri(((LinkNode) courObject).getLinkedUri());
  +                        .getUri(token, ((LinkNode) courObject).getLinkedUri());
                       
                       // 6 - We replace the courUri scope in the original uri
                       String courStrUri = courUri.toString();
  @@ -395,7 +395,7 @@
                   // Note : courUri still IS the Uri of the link, and so,
                   // in a way courUri is the parent of linkedUri.
                   Uri linkedUri = namespace
  -                    .getUri(((LinkNode) courObject).getLinkedUri());
  +                    .getUri(token, ((LinkNode) courObject).getLinkedUri());
                   
                   // 6 - We replace the courUri scope in the original uri
                   String courStrUri = courUri.toString();
  
  
  
  No                   revision
  No                   revision
  1.80.2.2  +4 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/PropertyHelper.java
  
  Index: PropertyHelper.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/PropertyHelper.java,v
  retrieving revision 1.80.2.1
  retrieving revision 1.80.2.2
  diff -u -r1.80.2.1 -r1.80.2.2
  --- PropertyHelper.java       1 Sep 2004 10:40:18 -0000       1.80.2.1
  +++ PropertyHelper.java       27 Oct 2004 15:43:11 -0000      1.80.2.2
  @@ -1532,7 +1532,7 @@
        * @throws   JDOMException
        */
       public XMLValue computeSupportedPrivilegeSet(NodeRevisionDescriptors 
revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String 
slideContextPath) throws ObjectLockedException, RevisionDescriptorNotFoundException, 
ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException, 
ObjectNotFoundException, LockTokenNotFoundException, JDOMException {
  -        Map actionAggregation = 
((SecurityImpl)nsaToken.getSecurityHelper()).getActionAggregation();
  +        Map actionAggregation = 
((SecurityImpl)nsaToken.getSecurityHelper()).getActionAggregation(sToken);
           Set rootSet = new HashSet(actionAggregation.keySet());
           Iterator actions = actionAggregation.keySet().iterator();
           while (actions.hasNext()) {
  
  
  
  No                   revision
  No                   revision
  1.53.2.3  +18 -18    
jakarta-slide/src/share/org/apache/slide/security/SecurityImpl.java
  
  Index: SecurityImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/security/SecurityImpl.java,v
  retrieving revision 1.53.2.2
  retrieving revision 1.53.2.3
  diff -u -r1.53.2.2 -r1.53.2.3
  --- SecurityImpl.java 7 Oct 2004 13:17:34 -0000       1.53.2.2
  +++ SecurityImpl.java 27 Oct 2004 15:43:12 -0000      1.53.2.3
  @@ -1077,9 +1077,9 @@
        * @throws   SlideException
        * @throws   JDOMException
        */
  -    private static synchronized Set getActionAggregates(SecurityImpl security, 
ActionNode aNode) throws SlideException, JDOMException {
  +    private static synchronized Set getActionAggregates(SecurityImpl security, 
SlideToken token, ActionNode aNode) throws SlideException, JDOMException {
           Set result = new HashSet();
  -        Uri aNodeUri = security.namespace.getUri(aNode.getUri());
  +        Uri aNodeUri = security.namespace.getUri(token, aNode.getUri());
           NodeRevisionDescriptor aNrd = 
aNodeUri.getStore().retrieveRevisionDescriptor(aNodeUri, new NodeRevisionNumber());
           NodeProperty membersProp = aNrd.getProperty(PRIVILEGE_MEMBER_SET);
           if (membersProp != null && membersProp.getValue() != null) {
  @@ -1227,9 +1227,9 @@
        * Method getActionAggregation
        * @return   a Map: actionNode -> Set-of-aggregated-nodes (direct aggregates)
        */
  -    public Map getActionAggregation() {
  +    public Map getActionAggregation(SlideToken token) {
           logger.log("Action aggregation being retrieved", LOG_CHANNEL, Logger.DEBUG);
  -        return Collections.unmodifiableMap(getActionAggregationImpl(this));
  +        return Collections.unmodifiableMap(getActionAggregationImpl(this, token));
       }
   
       /**
  @@ -1318,16 +1318,16 @@
        * @param namespace
        * @param namespaceConfig
        */
  -    private static synchronized void loadActionsCache(SecurityImpl security) {
  +    private static synchronized void loadActionsCache(SecurityImpl security, 
SlideToken token) {
           ActionsCache cache = getActionsCache(security);
           try {
               cache.aggregation = new HashMap();
               cache.aggregationClosure = new HashMap();
               String actionsPath = security.namespaceConfig.getActionsPath();
  -            Uri actionsPathUri = security.namespace.getUri(actionsPath);
  +            Uri actionsPathUri = security.namespace.getUri(token, actionsPath);
               ObjectNode actionsPathNode = 
actionsPathUri.getStore().retrieveObject(actionsPathUri);
               Enumeration actions = actionsPathNode.enumerateChildren();
  -            addActionLeafsToActionAggregation(security, cache, actions);
  +            addActionLeafsToActionAggregation(security, token, cache, actions);
   
               Iterator keys = cache.aggregationClosure.keySet().iterator();
               while (keys.hasNext()) {
  @@ -1367,15 +1367,15 @@
        * @throws SlideException
        * @throws JDOMException
        */
  -    private static synchronized void addActionLeafsToActionAggregation(SecurityImpl 
security, ActionsCache cache, Enumeration actions) throws SlideException, 
JDOMException {
  +    private static synchronized void addActionLeafsToActionAggregation(SecurityImpl 
security, SlideToken token, ActionsCache cache, Enumeration actions) throws 
SlideException, JDOMException {
           while (actions.hasMoreElements()) {
  -            Uri aNodeUri = security.namespace.getUri((String)actions.nextElement());
  +            Uri aNodeUri = security.namespace.getUri(token, 
(String)actions.nextElement());
               ObjectNode oNode = 
security.namespace.getStore(aNodeUri.getScope()).retrieveObject(aNodeUri);
               if (oNode.hasChildren()) {
                   if (security.logger.isEnabled(Logger.DEBUG)) {
                       security.logger.log("Adding children of action " + 
oNode.getUri() + " to action aggregation", LOG_CHANNEL, Logger.DEBUG);
                   }
  -                addActionLeafsToActionAggregation(security, cache, 
oNode.enumerateChildren());
  +                addActionLeafsToActionAggregation(security, token, cache, 
oNode.enumerateChildren());
               } else {
                   if (security.logger.isEnabled(Logger.DEBUG)) {
                       security.logger.log("Adding action " + oNode.getUri() + " to 
action aggregation", LOG_CHANNEL, Logger.DEBUG);
  @@ -1390,7 +1390,7 @@
                       actionNamespace = org.jdom.Namespace.getNamespace("DAV:");
                   }
                   aNode = ActionNode.getActionNode(oNode.getUri(), actionNamespace);
  -                Set directAggregates = getActionAggregates(security, aNode);
  +                Set directAggregates = getActionAggregates(security, token, aNode);
                   cache.aggregation.put(aNode, directAggregates);
                   Set aClosure = new HashSet();
                   aClosure.add(aNode);
  @@ -1438,10 +1438,10 @@
        * @return A map from actions to their aggregated actions, or and empty map
        *         if loading of the actions cache failed.
        */
  -    private static synchronized Map getActionAggregationImpl(SecurityImpl security) 
{
  +    private static synchronized Map getActionAggregationImpl(SecurityImpl security, 
SlideToken token) {
           ActionsCache cache = getActionsCache(security);
           if (!cache.hasBeenLoaded()) {
  -            loadActionsCache(security);
  +            loadActionsCache(security, token);
           }
           if (cache.hasLoadingFailed) {
               security.logger.log("actionAggregation retrieved but cache didn't load 
successfully" , LOG_CHANNEL, Logger.WARNING);
  @@ -1463,7 +1463,7 @@
       private static synchronized Map getActionAggregationClosureImpl(SecurityImpl 
security, SlideToken token, String uri) throws ServiceAccessException {
           ActionsCache cache = getActionsCache(security);
           if (!cache.hasBeenLoaded()) {
  -            loadActionsCache(security);
  +            loadActionsCache(security, token);
           }
           if (cache.hasLoadingFailed()) {
               Uri u = security.namespace.getUri(token, uri);
  
  
  

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

Reply via email to