javax.security.auth.kerberos
Class ServicePermission

java.lang.Object
  extended by java.security.Permission
      extended by javax.security.auth.kerberos.ServicePermission
All Implemented Interfaces:
Serializable, Guard

public final class ServicePermission
extends Permission

This represents permission to access to a Kerberos service principal. See the Kerberos authentication RFC for more information: RFC 1510.

Since:
1.4
See Also:
Serialized Form

Constructor Summary
ServicePermission(String name, String action)
          Create a new service permission with the indicated name and actions.
 
Method Summary
 boolean equals(Object obj)
          Check to see if this object equals obj.
 String getActions()
          Return a string representing the actions.
 int hashCode()
          This method returns a hash code for this Permission.
 boolean implies(Permission perm)
          This method tests whether this Permission implies that the specified Permission is also granted.
 PermissionCollection newPermissionCollection()
          This method returns an empty PermissionCollection object that can store permissions of this type, or null if no such collection is defined.
 
Methods inherited from class java.security.Permission
checkGuard, getName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServicePermission

public ServicePermission(String name,
                         String action)
Create a new service permission with the indicated name and actions. The name is the name of the kerberos principal for the service. The actions are a comma-separated list of strings. The recognized actions are "initiate" and "accept". The "initiate" action means that the holder of the permission can access the service. The "accept" action means that the holder of the permission can operate as this service.

Parameters:
name - the prinicpal's name
action - the allowed actions
Method Detail

implies

public boolean implies(Permission perm)
Description copied from class: Permission
This method tests whether this Permission implies that the specified Permission is also granted.

Specified by:
implies in class Permission
Parameters:
perm - the Permission to test against
Returns:
true if perm is implied by this

equals

public boolean equals(Object obj)
Description copied from class: Permission
Check to see if this object equals obj. Use implies, rather than equals, when making access control decisions.

Specified by:
equals in class Permission
Parameters:
obj - the object to compare to
Returns:
whether this Object is semantically equal to another
See Also:
Object.hashCode()

hashCode

public int hashCode()
Description copied from class: Permission
This method returns a hash code for this Permission. It must satisfy the contract of Object.hashCode: it must be the same for all objects that equals considers to be the same.

Specified by:
hashCode in class Permission
Returns:
a hash value
See Also:
Object.equals(Object), System.identityHashCode(Object)

getActions

public String getActions()
Return a string representing the actions.

Specified by:
getActions in class Permission
Returns:
the action list for this Permission

newPermissionCollection

public PermissionCollection newPermissionCollection()
Description copied from class: Permission
This method returns an empty PermissionCollection object that can store permissions of this type, or null if no such collection is defined. Subclasses must override this to provide an appropriate collection when one is needed to accurately calculate implies.

Overrides:
newPermissionCollection in class Permission
Returns:
a new PermissionCollection