1 package org.hibernate.secure; 3 4 import javax.security.jacc.EJBMethodPermission ; 5 6 import org.hibernate.event.PreDeleteEvent; 7 import org.hibernate.event.def.DefaultPreDeleteEventListener; 8 9 14 public class JACCPreDeleteEventListener extends DefaultPreDeleteEventListener { 15 public boolean onPreDelete(PreDeleteEvent event) { 16 17 EJBMethodPermission insertPermission = new EJBMethodPermission ( 18 event.getPersister().getEntityName(), 19 HibernatePermission.DELETE, 20 null, 21 null 22 ); 23 24 JACCPermissions.checkPermission( event.getEntity().getClass(), insertPermission ); 25 26 return super.onPreDelete( event ); 27 } 28 29 } 30 | Popular Tags |