Top Fields Constructors Methods
org.hibernate.secure

public Class HibernatePermission

extends Permission
Class Inheritance
Imports
java.security.Permission

Author
Gavin King

Field Summary

Modifier and TypeField and Description
private final String
public static final String
public static final String
public static final String
public static final String
public static final String

Constructor Summary

AccessConstructor and Description
public
HibernatePermission(String entityName, String actions)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the object we are testing for equality with this object.
obj
)

Implements abstract java.security.Permission.equals.

Checks two Permission objects for equality.
public String
getActions()

Implements abstract java.security.Permission.getActions.

Returns the actions as a String.
public int
hashCode()

Implements abstract java.security.Permission.hashCode.

Returns the hash code value for this Permission object.
public boolean
implies(Permission
the permission to check against.
permission
)

Implements abstract java.security.Permission.implies.

Checks if the specified permission's actions are "implied by" this object's actions.
public String
toString()

Overrides java.security.Permission.toString.

Returns a string describing this Permission.
Inherited from java.security.Permission:
checkGuardgetNamenewPermissionCollection

Field Detail

actionsback to summary
private final String actions
ANYback to summary
public static final String ANY
DELETEback to summary
public static final String DELETE
INSERTback to summary
public static final String INSERT
READback to summary
public static final String READ
UPDATEback to summary
public static final String UPDATE

Constructor Detail

HibernatePermissionback to summary
public HibernatePermission(String entityName, String actions)

Method Detail

equalsback to summary
public boolean equals(Object obj)

Implements abstract java.security.Permission.equals.

Doc from java.security.Permission.equals.

Checks two Permission objects for equality.

Do not use the equals method for making access control decisions; use the implies method.

Parameters
obj:Object

the object we are testing for equality with this object.

Returns:boolean

true if both Permission objects are equivalent.

getActionsback to summary
public String getActions()

Implements abstract java.security.Permission.getActions.

Doc from java.security.Permission.getActions.

Returns the actions as a String. This is abstract so subclasses can defer creating a String representation until one is needed. Subclasses should always return actions in what they consider to be their canonical form. For example, two FilePermission objects created via the following:

  perm1 = new FilePermission(p1,"read,write");
  perm2 = new FilePermission(p2,"write,read");
both return "read,write" when the getActions method is invoked.
Returns:String

the actions of this Permission.

hashCodeback to summary
public int hashCode()

Implements abstract java.security.Permission.hashCode.

Doc from java.security.Permission.hashCode.

Returns the hash code value for this Permission object.

The required hashCode behavior for Permission Objects is the following:

  • Whenever it is invoked on the same Permission object more than once during an execution of a Java application, the hashCode method must consistently return the same integer. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two Permission objects are equal according to the equals method, then calling the hashCode method on each of the two Permission objects must produce the same integer result.
Returns:int

a hash code value for this object.

impliesback to summary
public boolean implies(Permission permission)

Implements abstract java.security.Permission.implies.

Doc from java.security.Permission.implies.

Checks if the specified permission's actions are "implied by" this object's actions.

This must be implemented by subclasses of Permission, as they are the only ones that can impose semantics on a Permission object.

The implies method is used by the AccessController to determine whether a requested permission is implied by another permission that is known to be valid in the current execution context.

Parameters
permission:Permission

the permission to check against.

Returns:boolean

true if the specified permission is implied by this object, false if not.

toStringback to summary
public String toString()

Overrides java.security.Permission.toString.

Doc from java.security.Permission.toString.

Returns a string describing this Permission. The convention is to specify the class name, the permission name, and the actions in the following format: '("ClassName" "name" "actions")', or '("ClassName" "name")' if actions list is null or empty.

Returns:String

information about this Permission.