public class ISPermission extends Permission
Permission
which extends the
Permission
class. This is the only
API which gets used by an application/container to evaluate policy against
the OpenAM Policy framework. This class provides implementations
of all the required abstract methods of java.security.Permission
, in a way that the policy evaluation is made against the OpenAM
Policy service.
For example, one would use this class as follows to evaluate policy permissions:
ISPermission perm = new ISPermission("iPlanetAMWebAgentService", "http://www.example.com:80","GET"); AccessController.checkPermission(perm);If OpenAM has the policy service
iPlanetAMWebAgentService
which has a Rule
defined
for resource http://www.example.com:80
with action "GET" with allow privilege, this call will return quietly, if
such a policy is not found then access is denied and Exception thrown
accordingly. Also ISPermission
co-exists with the
permissions specified in the JDK policy store ( by default file
sun.security.provider.PolicyFile
or defined on the command line
using the -D option.
Permission
,
Subject
,
,
Serialized FormModifier | Constructor and Description |
---|---|
|
ISPermission(CodeSource codesource)
Constructs an
ISPermission instance, with the specified
CodeSource . |
protected |
ISPermission(ProtectionDomain pd)
Constructs an
ISPermission instance, with the specified
ProtectionDomain . |
|
ISPermission(String serviceName,
String resourceName,
String actions)
Constructs an
ISPermission instance, with the specified
service name, resource name and action name. |
|
ISPermission(String serviceName,
String resourceName,
String actions,
Map envParams)
Constructs an
ISPermission instance, with the specified
service name, resource name and action name. |
|
ISPermission(Subject subject,
CodeSource codesource)
Constructs an
ISPermission instance, with the specified
Subject and the CodeSource . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Returns true if two
ISPermission objects for equality. |
String |
getActions()
returns a comma separated list of actions associated with this
ISPermission . |
CodeSource |
getCodeSource()
returns the
CodeSource associated with this
ISPermission . |
Map |
getEnvParams()
returns environment parameters and their values associated with this
ISPermission . |
ProtectionDomain |
getProtectionDomain()
returns the
ProtectionDomain associated with this
ISPermission . |
String |
getResourceName()
returns the name of the resource associated with this
ISPermission
. |
String |
getServiceName()
returns the name of the service associated with this
ISPermission
. |
Subject |
getSubject()
returns the
Subject associated with this ISPermission
. |
int |
hashCode()
Returns the hash code value for this Permission object.
|
boolean |
implies(Permission perm)
Checks if the specified permission's actions are "implied by"
this object's actions.
|
PermissionCollection |
newPermissionCollection()
Returns a
java.security.PermissionCollection to store this
kind of Permission. |
String |
toString()
Returns a string describing this Permission.
|
checkGuard, getName
protected ISPermission(ProtectionDomain pd)
ISPermission
instance, with the specified
ProtectionDomain
.pd
- ProtectionDomain
for which this
ISPermission
is being created.public ISPermission(Subject subject, CodeSource codesource)
ISPermission
instance, with the specified
Subject
and the CodeSource
.subject
- Subject
for which this
ISPermission
is being created.codesource
- CodeSource
for which this permission is
being created.public ISPermission(CodeSource codesource)
ISPermission
instance, with the specified
CodeSource
.codesource
- CodeSource
for which this permission is
being created.public ISPermission(String serviceName, String resourceName, String actions)
ISPermission
instance, with the specified
service name, resource name and action name.serviceName
- name of service for which this
ISPermission
is being created. This name needs to be
one of the loaded services in the OpenAM's policy
engine. example: iPlanetAMWegAgentService
resourceName
- name of the resource for which this
ISPermission
is being defined.actions
- name of the action that needs to be checked for. It
may be a String
like "GET", "POST" in case of
service name iPlanetAMWebAgentService
.public ISPermission(String serviceName, String resourceName, String actions, Map envParams)
ISPermission
instance, with the specified
service name, resource name and action name.serviceName
- name of service for which this
ISPermission
is being created. This name needs to be
one of the loaded policy services in the OpenSSO.
example:
iPlanetAMWegAgentService
resourceName
- name of the resource for which this
ISPermission
is being defined.actions
- name of the action that needs to be checked for. It
may be a String
like "GET", "POST" in case of
service name iPlanetAMWebAgentService
.envParams
- a java.util.Map
of environment parameters
which are used by the
com.sun.identity.policy.client.PolicyEvaluator
to evaluate the com.sun.identity.policy.Conditions
associated with the policy. This is a Map of attribute-value pairs
representing the environment under which the policy needs to be
evaluated.public String getServiceName()
ISPermission
.String
representing the name of the service for this
permission.public String getResourceName()
ISPermission
.String
representing the name of the resource for
this permission.public Map getEnvParams()
ISPermission
.Map
representing the environment parameters of
this permission. The Map
consists of attribute
value pairs.public String getActions()
ISPermission
.getActions
in class Permission
String
representing the name
of the action for this object. For example for:
ISPermission isp = new ISPermission("iPlanetAMWebAgentService, "http://www.sun.com:80", "GET, POST"); getActions() would return "GET,POST"
public Subject getSubject()
Subject
associated with this ISPermission
.javax.security.auth.Subject
representing the
subject of this permission.public CodeSource getCodeSource()
CodeSource
associated with this
ISPermission
.java.security.CodeSource
representing the
codesource
of this permission.public ProtectionDomain getProtectionDomain()
ProtectionDomain
associated with this
ISPermission
.java.security.ProtectionDomain
representing the
protectionDomain
of this permission.public boolean equals(Object obj)
ISPermission
objects for equality.equals
in class Permission
obj
- ISPermission
object.codesource
, service name, resource
name actions and environment parameters of both objects are
equal.public int hashCode()
The required hashCode
behavior for Permission Objects is
the following:
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.
equals
method, then calling the hashCode
method on each of the
two Permission objects must produce the same integer result.
hashCode
in class Permission
public boolean implies(Permission perm)
The implies
method is used by the
AccessController
to determine whether or not a requested
permission is implied by another permission that is known to be valid
in the current execution context.
implies
in class Permission
perm
- the permission to check against.public PermissionCollection newPermissionCollection()
java.security.PermissionCollection
to store this
kind of Permission.newPermissionCollection
in class Permission
ISPermissionCollection
public String toString()
toString
in class Permission
String
containing information about this Permission.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.