1 package org.hibernate.secure; 3 4 import javax.security.jacc.EJBMethodPermission ; 5 6 import org.hibernate.event.PreLoadEvent; 7 import org.hibernate.event.def.DefaultPreLoadEventListener; 8 import org.hibernate.secure.HibernatePermission; 9 10 16 public class JACCPreLoadEventListener extends DefaultPreLoadEventListener { 17 public void onPreLoad(PreLoadEvent event) { 18 19 EJBMethodPermission insertPermission = new EJBMethodPermission ( 20 event.getPersister().getEntityName(), 21 HibernatePermission.READ, 22 null, 23 null 24 ); 25 26 JACCPermissions.checkPermission( event.getEntity().getClass(), insertPermission ); 27 28 super.onPreLoad( event ); 29 } 30 31 } 32 | Popular Tags |