KickJava   Java API By Example, From Geeks To Geeks.

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


1 //$Id: JACCPreUpdateEventListener.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.PreUpdateEvent;
7 import org.hibernate.event.def.DefaultPreUpdateEventListener;
8 import org.hibernate.secure.HibernatePermission;
9
10 /**
11  * Comment
12  *
13  * @author <a HREF="mailto:kabir.khan@jboss.org">Kabir Khan</a>
14  * @version $Revision: 1.8 $
15  */

16 public class JACCPreUpdateEventListener extends DefaultPreUpdateEventListener {
17     public boolean onPreInsert(PreUpdateEvent event) {
18
19         EJBMethodPermission JavaDoc insertPermission = new EJBMethodPermission JavaDoc(
20                 event.getPersister().getEntityName(),
21                 HibernatePermission.UPDATE,
22                 null,
23                 null
24             );
25
26         JACCPermissions.checkPermission( event.getEntity().getClass(), insertPermission );
27
28         return super.onPreUpdate( event );
29     }
30
31 }
32
Popular Tags