FileDocCategorySizeDatePackage
HibernatePermission.javaAPI DocHibernate 3.2.51326Sat Feb 12 00:19:50 GMT 2005org.hibernate.secure

HibernatePermission

public class HibernatePermission extends Permission
author
Gavin King

Fields Summary
public static final String
INSERT
public static final String
UPDATE
public static final String
DELETE
public static final String
READ
public static final String
ANY
private final String
actions
Constructors Summary
public HibernatePermission(String entityName, String actions)


	     
		super(entityName);
		this.actions = actions;
	
Methods Summary
public booleanequals(java.lang.Object obj)

		if ( !(obj instanceof HibernatePermission) ) return false;
		HibernatePermission permission = (HibernatePermission) obj;
		return permission.getName().equals( getName() ) && 
			permission.getActions().equals(actions);
	
public java.lang.StringgetActions()

		return actions;
	
public inthashCode()

		return getName().hashCode() * 37 + actions.hashCode();
	
public booleanimplies(java.security.Permission permission)

		//TODO!
		return ( "*".equals( getName() ) || getName().equals( permission.getName() ) ) &&
			( "*".equals(actions) || actions.indexOf( permission.getActions() ) >= 0 );
	
public java.lang.StringtoString()

		return "HibernatePermission(" + getName() + ':" + actions + ')";