KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > secure > JACCPreDeleteEventListener


1 //$Id: JACCPreDeleteEventListener.java,v 1.8 2005/07/21 04:56:17 oneovthafew Exp $
2
package org.hibernate.secure;
3
4 import javax.security.jacc.EJBMethodPermission JavaDoc;
5
6 import org.hibernate.event.PreDeleteEvent;
7 import org.hibernate.event.def.DefaultPreDeleteEventListener;
8
9 /**
10  * Comment
11  *
12  * @author <a HREF="mailto:kabir.khan@jboss.org">Kabir Khan</a>
13  */

14 public class JACCPreDeleteEventListener extends DefaultPreDeleteEventListener {
15     public boolean onPreDelete(PreDeleteEvent event) {
16
17         EJBMethodPermission JavaDoc insertPermission = new EJBMethodPermission JavaDoc(
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