Author: jkoster
Date: 2009-06-02 13:53:47 +0200 (Tue, 02 Jun 2009)
New Revision: 35571
Modified:
CMSContainer/trunk/CMSContainer/cmsc/sitemanagement/src/java/com/finalist/cmsc/navigation/NavigationUtil.java
Log:
CMSC-1416 - Site Management: Keep the Site folded when user does not have rights
Modified:
CMSContainer/trunk/CMSContainer/cmsc/sitemanagement/src/java/com/finalist/cmsc/navigation/NavigationUtil.java
===================================================================
---
CMSContainer/trunk/CMSContainer/cmsc/sitemanagement/src/java/com/finalist/cmsc/navigation/NavigationUtil.java
2009-06-02 11:53:44 UTC (rev 35570)
+++
CMSContainer/trunk/CMSContainer/cmsc/sitemanagement/src/java/com/finalist/cmsc/navigation/NavigationUtil.java
2009-06-02 11:53:47 UTC (rev 35571)
@@ -454,20 +454,21 @@
if (info == null) {
info = new NavigationInfo();
cloud.setProperty(NavigationInfo.class.getName(), info);
- addAllSiteToInfo(cloud, info);
+ //addAllSiteToInfo(cloud, info); //Turned off for better user
experience
addPagesWithRoleToInfo(cloud, info);
}
return info;
}
- private static void addAllSiteToInfo(Cloud cloud, NavigationInfo info) {
+
+/* private static void addAllSiteToInfo(Cloud cloud, NavigationInfo info) {
NodeList allSites = SiteUtil.getSites(cloud);
for(NodeIterator i = allSites.nodeIterator(); i.hasNext(); ) {
Node site = i.nextNode();
info.expand(site.getNumber());
}
}
-
+*/
private static void addPagesWithRoleToInfo(Cloud cloud, NavigationInfo
info) {
TreeMap<String,UserRole> pagesWithRole =
SecurityUtil.getLoggedInRoleMap(cloud, treeManagers, NAVREL);
for(Map.Entry<String,UserRole> entry : pagesWithRole.entrySet()) {
@@ -476,17 +477,15 @@
String path = entry.getKey();
Node page = getPageFromPath(cloud, path);
if(page != null) {
- if (!SiteUtil.isSite(page)) {
- List<Node> pathNodes = getPathToRoot(page);
- for (Node pathNode : pathNodes) {
- info.expand(pathNode.getNumber());
- String pathToRoot = getPathToRootString(pathNode);
- UserRole pathRole = pagesWithRole.get(pathToRoot);
- if (pathRole != null &&
!Role.NONE.equals(pathRole.getRole())) {
- break;
- }
- }
- }
+ List<Node> pathNodes = getPathToRoot(page);
+ for (Node pathNode : pathNodes) {
+ info.expand(pathNode.getNumber());
+ String pathToRoot = getPathToRootString(pathNode);
+ UserRole pathRole = pagesWithRole.get(pathToRoot);
+ if (pathRole != null &&
!Role.NONE.equals(pathRole.getRole())) {
+ break;
+ }
+ }
}
}
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs