Index: topia-security/src/java/org/codelutin/topia/security/listener/EntityVetoable.java diff -u topia-security/src/java/org/codelutin/topia/security/listener/EntityVetoable.java:1.2 topia-security/src/java/org/codelutin/topia/security/listener/EntityVetoable.java:1.3 --- topia-security/src/java/org/codelutin/topia/security/listener/EntityVetoable.java:1.2 Wed Oct 25 12:47:15 2006 +++ topia-security/src/java/org/codelutin/topia/security/listener/EntityVetoable.java Fri Oct 27 08:03:38 2006 @@ -24,9 +24,9 @@ * Created: 10 févr. 2006 * * @author Arnaud Thimel -* @version $Revision: 1.2 $ +* @version $Revision: 1.3 $ * -* Mise a jour: $Date: 2006/10/25 12:47:15 $ +* Mise a jour: $Date: 2006/10/27 08:03:38 $ * par : $Author: ruchaud $ */ @@ -41,7 +41,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.codelutin.topia.TopiaException; import org.codelutin.topia.TopiaNotFoundException; import org.codelutin.topia.event.TopiaEntityEvent; import org.codelutin.topia.event.TopiaEntityVetoable; @@ -81,12 +80,7 @@ if (log.isDebugEnabled()) { log.debug("[Security] create entity : " + clazz.getName()); } - - try { - securityManager.checkPermission(clazz, CREATE); - } catch (TopiaException te) { - throw new SecurityException("Access denied to entity creation", te); - } + securityManager.checkPermission(clazz, CREATE); } /* (non-Javadoc) @@ -97,11 +91,7 @@ if (log.isDebugEnabled()) { log.debug("[Security] delete entity : " + topiaId); } - try { - securityManager.checkPermission(topiaId, DELETE); - } catch (TopiaException te) { - throw new SecurityException("Access denied to entity deletion", te); - } + securityManager.checkPermission(topiaId, DELETE); } /* @@ -128,7 +118,7 @@ try { securityManager.checkPermission(topiaId, LOAD); - } catch (TopiaException te) { + } catch (SecurityException te) { authorized = false; } Index: topia-security/src/java/org/codelutin/topia/security/listener/PropertyWriteListener.java diff -u topia-security/src/java/org/codelutin/topia/security/listener/PropertyWriteListener.java:1.5 topia-security/src/java/org/codelutin/topia/security/listener/PropertyWriteListener.java:1.6 --- topia-security/src/java/org/codelutin/topia/security/listener/PropertyWriteListener.java:1.5 Wed Oct 18 08:46:34 2006 +++ topia-security/src/java/org/codelutin/topia/security/listener/PropertyWriteListener.java Fri Oct 27 08:03:38 2006 @@ -28,9 +28,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.codelutin.topia.TopiaException; import org.codelutin.topia.persistence.TopiaEntityAbstract; -import org.codelutin.topia.security.TopiaSecurityService; +import org.codelutin.topia.security.TopiaSecurityServiceImpl; /** * Listenner permettant de vérifier les autorisations pour le modification d'une @@ -41,9 +40,9 @@ private static Log log = LogFactory.getLog(PropertyWriteListener.class); - private TopiaSecurityService securityManager; + private TopiaSecurityServiceImpl securityManager; - public PropertyWriteListener(TopiaSecurityService securityManager) { + public PropertyWriteListener(TopiaSecurityServiceImpl securityManager) { this.securityManager = securityManager; } @@ -56,7 +55,7 @@ TopiaEntityAbstract entity = (TopiaEntityAbstract) source; try { securityManager.checkPermission(entity.getTopiaId(), UPDATE); - } catch (TopiaException te) { + } catch (SecurityException te) { if (log.isWarnEnabled()) { log.warn("[Security] Write denied to : " + entity.getTopiaId(), te); } Index: topia-security/src/java/org/codelutin/topia/security/listener/PropertyReadListener.java diff -u topia-security/src/java/org/codelutin/topia/security/listener/PropertyReadListener.java:1.6 topia-security/src/java/org/codelutin/topia/security/listener/PropertyReadListener.java:1.7 --- topia-security/src/java/org/codelutin/topia/security/listener/PropertyReadListener.java:1.6 Wed Oct 18 08:46:34 2006 +++ topia-security/src/java/org/codelutin/topia/security/listener/PropertyReadListener.java Fri Oct 27 08:03:38 2006 @@ -28,7 +28,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.codelutin.topia.TopiaException; import org.codelutin.topia.persistence.TopiaEntityAbstract; import org.codelutin.topia.security.TopiaSecurityServiceImpl; @@ -65,7 +64,7 @@ } else { // Sinon try { securityManager.checkPermission(entity.getTopiaId(), LOAD); - } catch (TopiaException te) { + } catch (SecurityException te) { if (log.isWarnEnabled()) { log.warn("[Security] Read denied to : " + entity.getTopiaId(), te); }