Index: topia-security/src/java/org/codelutin/topia/security/listener/VetoableEntityListener.java diff -u topia-security/src/java/org/codelutin/topia/security/listener/VetoableEntityListener.java:1.3 topia-security/src/java/org/codelutin/topia/security/listener/VetoableEntityListener.java:1.4 --- topia-security/src/java/org/codelutin/topia/security/listener/VetoableEntityListener.java:1.3 Tue Oct 3 08:33:17 2006 +++ topia-security/src/java/org/codelutin/topia/security/listener/VetoableEntityListener.java Tue Oct 3 14:55:23 2006 @@ -24,9 +24,9 @@ * Created: 10 févr. 2006 * * @author Arnaud Thimel -* @version $Revision: 1.3 $ +* @version $Revision: 1.4 $ * -* Mise a jour: $Date: 2006/10/03 08:33:17 $ +* Mise a jour: $Date: 2006/10/03 14:55:23 $ * par : $Author: ruchaud $ */ @@ -58,7 +58,8 @@ * suppression d'une entité. * @author ruchaud */ -public class VetoableEntityListener implements TopiaVetoableEntityListener, TopiaVetoableEntityLoadListener { +public class VetoableEntityListener implements TopiaVetoableEntityListener, + TopiaVetoableEntityLoadListener { private static Log log = LogFactory.getLog(VetoableEntityListener.class); @@ -103,6 +104,25 @@ if (log.isDebugEnabled()) { log.debug("[Security] load entity : " + event.getId()); } + + /* Vérification dans le cache */ + Subject subject = Subject.getSubject(AccessController.getContext()); + if (subject != null) { + boolean modified = false; + + for (Principal principal : subject.getPrincipals()) { + Object object = TopiaSecurityManagerImpl.cachingLOAD.get(event.getId(), principal.getName()); + + if(object != null) { + modified = true; + } + } + + if(modified) { + return true; + } + } + try { checkPermission((String)event.getId(), LOAD); @@ -110,7 +130,6 @@ check = false; } /* Mise en cache */ - Subject subject = Subject.getSubject(AccessController.getContext()); if (subject != null) { for (Principal principal : subject.getPrincipals()) { TopiaSecurityManagerImpl.cachingLOAD.put(check, event.getId(), principal.getName());