FileDocCategorySizeDatePackage
JACCPreInsertEventListener.javaAPI DocHibernate 3.2.51076Tue Nov 29 11:34:30 GMT 2005org.hibernate.secure

JACCPreInsertEventListener

public class JACCPreInsertEventListener extends Object implements org.hibernate.event.Initializable, org.hibernate.event.PreInsertEventListener, JACCSecurityListener
Check security before an insertion
author
Kabir Khan

Fields Summary
private String
contextID
Constructors Summary
Methods Summary
public voidinitialize(org.hibernate.cfg.Configuration cfg)

      contextID = cfg.getProperty(Environment.JACC_CONTEXTID);
   
public booleanonPreInsert(org.hibernate.event.PreInsertEvent event)


		EJBMethodPermission insertPermission = new EJBMethodPermission(
				event.getPersister().getEntityName(),
				HibernatePermission.INSERT,
				null,
				null
		);

		JACCPermissions.checkPermission( event.getEntity().getClass(), contextID, insertPermission );

		return false;