Author: tdraier
Date: Thu Sep 27 16:49:22 2007
New Revision: 18698
URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D18698&repname=
=3Djahia
Log:
optimized and fixed users/groups acl change
Modified:
branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/cache/Con=
tainerHTMLCache.java
Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/cac=
he/ContainerHTMLCache.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/services/cache/ContainerHTMLCache.java&rev=
=3D18698&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/cache/Con=
tainerHTMLCache.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/cache/Con=
tainerHTMLCache.java Thu Sep 27 16:49:22 2007
@@ -120,11 +120,7 @@
* and mode by removing the cache entries.</p>
*
* @param containerID the container identification number
-<<<<<<< .mine
- * @param mode the display mode for which to invalidate the containers.
-=3D=3D=3D=3D=3D=3D=3D
* @param mode the mode for which to invalidate the containers.
->>>>>>> .r18405
* @param languageCode the language code for which to invalidate the c=
ontainers.
*/
=
@@ -143,20 +139,33 @@
}
=
public void rightsUpdated() {
- if (groups !=3D null) {
- SortedSet newgroups =3D new TreeSet(ServicesRegistry.getInstan=
ce().getJahiaACLManagerService().getAllGroupsInAcl());
- if (!newgroups.equals(groups.keySet())) {
- groups =3D null;
- flush();
+ SortedSet newusers =3D new TreeSet(ServicesRegistry.getInstance().=
getJahiaACLManagerService().getAllUsersInAcl());
+
+ if (!newusers.equals(users)) {
+ Set removedUsers =3D new HashSet(users);
+ removedUsers.removeAll(newusers);
+
+ users =3D newusers;
+
+ for (Iterator iterator =3D removedUsers.iterator(); iterator.h=
asNext();) {
+ String s =3D (String) iterator.next();
+ flushGroup(USERNAME_PREFIX + s);
}
}
- users =3D new TreeSet(ServicesRegistry.getInstance().getJahiaACLMa=
nagerService().getAllUsersInAcl());
- groups =3D new TreeMap();
- Collection names =3D ServicesRegistry.getInstance().getJahiaACLMan=
agerService().getAllGroupsInAcl();
- for (Iterator iterator =3D names.iterator(); iterator.hasNext();) {
- String name =3D (String) iterator.next();
- JahiaGroup g =3D ServicesRegistry.getInstance().getJahiaGroupM=
anagerService().lookupGroup(name);
- groups.put(name,g);
+
+ SortedSet newgroupskeys =3D new TreeSet(ServicesRegistry.getInstan=
ce().getJahiaACLManagerService().getAllGroupsInAcl());
+ if (!newgroupskeys.equals(groups.keySet())) {
+ SortedMap newgroups =3D new TreeMap();
+ Collection names =3D ServicesRegistry.getInstance().getJahiaAC=
LManagerService().getAllGroupsInAcl();
+ for (Iterator iterator =3D names.iterator(); iterator.hasNext(=
);) {
+ String name =3D (String) iterator.next();
+ JahiaGroup g =3D ServicesRegistry.getInstance().getJahiaGr=
oupManagerService().lookupGroup(name);
+ newgroups.put(name,g);
+ }
+
+ groups =3D newgroups;
+
+ flush();
}
}
=
_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list