java.security
Class AllPermission

java.lang.Object
  extended by java.security.Permission
      extended by java.security.AllPermission
All Implemented Interfaces:
Serializable, Guard

public final class AllPermission
extends Permission

This class is a permission that implies all other permissions. Granting this permission effectively grants all others. Extreme caution should be exercised in granting this permission.

Since:
1.1
See Also:
AccessController, Permissions, SecurityManager, Serialized Form

Constructor Summary
AllPermission()
          Create a new AllPermission object.
AllPermission(String name, String actions)
          Create a new AllPermission object.
 
Method Summary
 boolean equals(Object obj)
          Checks an object for equality.
 String getActions()
          This method returns the list of actions associated with this object.
 int hashCode()
          This method returns a hash code for this object.
 boolean implies(Permission perm)
          This method always returns true to indicate that this permission always implies that any other permission is also granted.
 PermissionCollection newPermissionCollection()
          Returns a PermissionCollection which can hold AllPermission.
 
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

AllPermission

public AllPermission()
Create a new AllPermission object.


AllPermission

public AllPermission(String name,
                     String actions)
Create a new AllPermission object. The parameters are ignored, as all permission implies ALL PERMISSION.

Parameters:
name - ignored
actions - ignored
Method Detail

implies

public boolean implies(Permission perm)
This method always returns true to indicate that this permission always implies that any other permission is also granted.

Specified by:
implies in class Permission
Parameters:
perm - ignored
Returns:
true, the permission is implied

equals

public boolean equals(Object obj)
Checks an object for equality. All AllPermissions are equal.

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

hashCode

public int hashCode()
This method returns a hash code for this object. This returns 1.

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

getActions

public String getActions()
This method returns the list of actions associated with this object. This will always be the empty string ("") for this class.

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

newPermissionCollection

public PermissionCollection newPermissionCollection()
Returns a PermissionCollection which can hold AllPermission.

Overrides:
newPermissionCollection in class Permission
Returns:
a permission collection