java.security
public final class: AllPermission [javadoc |
source]
java.lang.Object
java.security.Permission
java.security.AllPermission
All Implemented Interfaces:
Serializable, Guard
{@code AllPermission} represents the permission to perform any operation.
Since its
#implies(Permission) method always returns {@code true},
granting this permission is equivalent to disabling security.
| Constructor: |
public AllPermission() {
super(ALL_PERMISSIONS);
}
Constructs a new instance of {@code AllPermission}. |
public AllPermission(String name,
String actions) {
super(ALL_PERMISSIONS);
}
Constructs a new instance of {@code AllPermission}. The two argument
version is provided for class {@code Policy} so that it has a consistent
call pattern across all permissions. The name and action list are both
ignored. Parameters:
name -
ignored.
actions -
ignored.
|
| Methods from java.lang.Object: |
|---|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from java.security.AllPermission Detail: |
public boolean equals(Object obj) {
return (obj instanceof AllPermission);
}
Compares the specified object with this {@code AllPermission} for
equality and returns {@code true} if the specified object is equal,
{@code false} otherwise. To be equal, the given object needs to be an
instance of {@code AllPermission}. |
public String getActions() {
return ALL_ACTIONS;
}
Returns the actions associated with this {@code AllPermission}. Since
{@code AllPermission} objects allow all actions, this method returns
always the string "<all actions>". |
public int hashCode() {
return 1;
}
Returns the hash code value for this {@code AllPermission}. Returns the
same hash code for {@code AllPermission}s that are equal to each other as
required by the general contract of Object#hashCode . |
public boolean implies(Permission permission) {
return true;
}
Indicates whether the given permission is implied by this permission.
{@code AllPermission} objects imply all other permissions. |
public PermissionCollection newPermissionCollection() {
return new AllPermissionCollection();
}
Returns a new {@code PermissionCollection} for holding permissions of
this class. |