java.lang.Object | |
↳ | java.security.Permission |
Known Direct Subclasses |
Known Indirect Subclasses |
Permission
is the common base class of all permissions that
participate in the access control security framework around
AccessController
and AccessControlContext
. A permission
constitutes of a name and associated actions.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new instance of
Permission with its name. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Invokes
checkPermission(Permission) with this
permission as its argument. | |||||||||||
Compares the specified object with this
Permission for equality
and returns true if the specified object is equal, false
otherwise. | |||||||||||
Returns a comma separated string identifying the actions associated with
this permission.
| |||||||||||
Returns the name of this permission.
| |||||||||||
Returns the hash code value for this
Permission . | |||||||||||
Indicates whether the specified permission is implied by this permission.
| |||||||||||
Returns a specific
PermissionCollection container for permissions
of this type. | |||||||||||
Returns a string containing a concise, human-readable description of the
this
Permission including its name and its actions. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.security.Guard
|
Constructs a new instance of Permission
with its name.
name | the name of the permission. |
---|
Invokes checkPermission(Permission)
with this
permission as its argument. This method implements the Guard
interface.
obj | as specified in checkGuard(Object) but ignored
in this implementation. |
---|
SecurityException | if this permission is not granted. |
---|
Compares the specified object with this Permission
for equality
and returns true
if the specified object is equal, false
otherwise.
The implies(Permission)
method should be used for making access
control checks.
obj | object to be compared for equality with this Permission . |
---|
true
if the specified object is equal to this Permission
, otherwise false
.
Returns a comma separated string identifying the actions associated with this permission. The returned actions are in canonical form. For example:
sp0 = new SocketPermission("www.example.com", "connect,resolve") sp1 = new SocketPermission("www.example.com", "resolve,connect") sp0.getActions().equals(sp1.getActions()) //yields trueBoth permissions return "connect,resolve" (in that order) if
#getActions()
is invoked. Returns an empty String, if no actions are
associated with this permission.Returns the name of this permission.
Returns the hash code value for this Permission
. Returns the same
hash code for Permission
s that are equal to each other as
required by the general contract of hashCode()
.
Permission
.Indicates whether the specified permission is implied by this permission.
The AccessController
uses this method to check whether permission
protected access is allowed with the present policy.
permission | the permission to check against this permission. |
---|
true
if the specified permission is implied by this
permission, false
otherwise.
Returns a specific PermissionCollection
container for permissions
of this type. Returns null
if any permission collection can be
used.
Subclasses may override this method to return an appropriate collection for the specific permissions they implement.
PermissionCollection
or null
if any
permission collection can be used.
Returns a string containing a concise, human-readable description of the
this Permission
including its name and its actions.
Permission
.