portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vku...@apache.org
Subject svn commit: r770628 - in /portals/jetspeed-2/portal/trunk: components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/impl/ components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/psml/ components/jetspeed-portal-...
Date Fri, 01 May 2009 10:44:48 GMT
Author: vkumar
Date: Fri May  1 10:44:48 2009
New Revision: 770628

URL: http://svn.apache.org/viewvc?rev=770628&view=rev
Log:
Adding new method in getAll(boolean filtered) in Folder Api to get sub nodes *with-out checking
access* on sub folders.
This method is required to throw security exception in getNodeProxy
http://issues.apache.org/jira/browse/JS2-900

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/SiteView.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/folder/Folder.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java?rev=770628&r1=770627&r2=770628&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java
Fri May  1 10:44:48 2009
@@ -1112,5 +1112,14 @@
             pageManager = (PageManager)Jetspeed.getComponentManager().getComponent("org.apache.jetspeed.page.PageManager");
         }        
         return pageManager;
+    }
+
+    public NodeSet getAll(boolean filtered) throws DocumentException
+    {
+        if (!filtered)
+        {
+            return getAllNodeSet();
+        }
+        return getAll();
     }     
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java?rev=770628&r1=770627&r2=770628&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java
Fri May  1 10:44:48 2009
@@ -964,5 +964,13 @@
             }
         }
     }
-    
+
+    public NodeSet getAll(boolean filtered) throws DocumentException
+    {
+        if (!filtered)
+        {
+            return getAllNodes();
+        }
+        return getAll();
+    }     
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/SiteView.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/SiteView.java?rev=770628&r1=770627&r2=770628&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/SiteView.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/SiteView.java
Fri May  1 10:44:48 2009
@@ -23,6 +23,7 @@
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.folder.FolderNotFoundException;
 import org.apache.jetspeed.om.folder.proxy.FolderProxy;
@@ -751,13 +752,14 @@
                 // and visibility is required
                 try
                 {
-                    NodeSet children = currentFolder.getAll();
+                    NodeSet children = currentFolder.getAll(false);
                     if (children != null)
                     {
                         Node node = children.get(currentPath);
                         if ((node != null) && (!onlyVisible || !node.isHidden() ||
(node == currentPage)) &&
                             (!onlyViewable || isProxyViewable(node, onlyVisible)))
                         {
+                            node.checkAccess(JetspeedActions.VIEW);
                             return node;
                         }
                     }
@@ -777,6 +779,7 @@
         if ((!onlyVisible || !currentFolder.isHidden()) &&
             (!onlyViewable || isProxyViewable(currentFolder, onlyVisible)))
         {
+            currentFolder.checkAccess(JetspeedActions.VIEW);
             return currentFolder;
         }
         throw new NodeNotFoundException("Specified path " + path + " not found or viewable/visible.");
@@ -1234,5 +1237,5 @@
             return pageProxy.getPage();
         }
         return null;
-    }
+    }    
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/folder/Folder.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/folder/Folder.java?rev=770628&r1=770627&r2=770628&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/folder/Folder.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/folder/Folder.java
Fri May  1 10:44:48 2009
@@ -246,6 +246,21 @@
      * @throws DocumentException
      */
     NodeSet getAll() throws DocumentException;
+    
+    /**
+     * 
+     * <p>
+     * getAll
+     * 
+     * if filtered param is true, it will return accessed pages
+     * if filtered param is false it will return all pages
+     * </p>
+     *
+     * @return A <code>NodeSet</code> containing all (including nodes, on which
you don't have access) sub-folders and documents directly under
+     * this folder.
+     * @throws DocumentException
+     */
+    NodeSet getAll(boolean filtered) throws DocumentException;
 
     /**
      * getMenuDefinitions - get list of menu definitions



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message