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

JACCPreDeleteEventListener

public class JACCPreDeleteEventListener extends Object implements org.hibernate.event.Initializable, org.hibernate.event.PreDeleteEventListener, JACCSecurityListener
Check security before any deletion
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 booleanonPreDelete(org.hibernate.event.PreDeleteEvent event)


		EJBMethodPermission deletePermission = new EJBMethodPermission(
				event.getPersister().getEntityName(),
				HibernatePermission.DELETE,
				null,
				null
		);

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

		return false;