Author: jkoster
Date: 2009-06-02 13:42:50 +0200 (Tue, 02 Jun 2009)
New Revision: 35567
Modified:
CMSContainer/branches/b1_4/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/RepositoryUtil.java
CMSContainer/branches/b1_4/CMSContainer/cmsc/sitemanagement/src/java/com/finalist/cmsc/navigation/NavigationUtil.java
Log:
CMSC-1415 - Site tree collapses pages too often: only collapse when getting
higher rights.
Modified:
CMSContainer/branches/b1_4/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/RepositoryUtil.java
===================================================================
---
CMSContainer/branches/b1_4/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/RepositoryUtil.java
2009-06-02 11:42:39 UTC (rev 35566)
+++
CMSContainer/branches/b1_4/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/RepositoryUtil.java
2009-06-02 11:42:50 UTC (rev 35567)
@@ -946,6 +946,12 @@
if (info == null) {
info = new RepositoryInfo();
cloud.setProperty(RepositoryInfo.class.getName(), info);
+ addChannelsWithRoleToInfo(cloud, info);
+ }
+ return info;
+ }
+
+ private static void addChannelsWithRoleToInfo(Cloud cloud, RepositoryInfo
info) {
TreeMap<String,UserRole> channelsWithRole =
SecurityUtil.getLoggedInRoleMap(cloud, treeManagers, CHILDREL);
for(Map.Entry<String,UserRole> entry :
channelsWithRole.entrySet()) {
@@ -961,13 +967,17 @@
List<Node> pathNodes = getPathToRoot(channel);
for (Node pathNode : pathNodes) {
info.expand(pathNode.getNumber());
+
+ String pathToRoot = getPathToRootString(pathNode);
+ UserRole pathRole = channelsWithRole.get(pathToRoot);
+ if (pathRole != null &&
!Role.NONE.equals(pathRole.getRole())) {
+ break;
}
}
}
}
}
}
- return info;
}
public static RolesInfo getRolesInfo(Cloud cloud, Node group) {
Modified:
CMSContainer/branches/b1_4/CMSContainer/cmsc/sitemanagement/src/java/com/finalist/cmsc/navigation/NavigationUtil.java
===================================================================
---
CMSContainer/branches/b1_4/CMSContainer/cmsc/sitemanagement/src/java/com/finalist/cmsc/navigation/NavigationUtil.java
2009-06-02 11:42:39 UTC (rev 35566)
+++
CMSContainer/branches/b1_4/CMSContainer/cmsc/sitemanagement/src/java/com/finalist/cmsc/navigation/NavigationUtil.java
2009-06-02 11:42:50 UTC (rev 35567)
@@ -460,7 +460,12 @@
if (!SiteUtil.isSite(page)) {
List<Node> pathNodes = getPathToRoot(page);
for (Node pathNode : pathNodes) {
- info.expand(pathNode.getNumber());
+ 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