com.sun.identity.policy.jaas
クラス ISPermission

java.lang.Object
  上位を拡張 java.security.Permission
      上位を拡張 com.sun.identity.policy.jaas.ISPermission

public class ISPermission
extends Permission

This class provides the support for JAAS Authorization service Its a new JAAS Permission which extends the Permission class. This is the only API which gets used by an application/container to evaluate policy against the OpenSSO 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 OpenSSO Enterprise's Policy service.

For example, one would use this class as follows to evaluate policy permissions:

 ISPermission perm = new ISPermission("iPlanetAMWebAgentService",
                  "http://www.sun.com:80","GET");
 AccessController.checkPermission(perm);
 
If OpenSSO has the policy service iPlanetAMWebAgentService which has a Rule defined for resource http://www.sun.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,

, 直列化された形式


コンストラクタの概要
  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.
 
メソッドの概要
 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 CodeSourceassociated with this ISPermission.
 Map getEnvParams()
          returns environment parameters and their values associated with this ISPermission.
 ProtectionDomain getProtectionDomain()
          returns the ProtectionDomainassociated 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 Subjectassociated 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.
 

コンストラクタの詳細

ISPermission

protected ISPermission(ProtectionDomain pd)
Constructs an ISPermission instance, with the specified ProtectionDomain.

パラメータ:
pd - ProtectionDomain for which this ISPermission is being created.

ISPermission

public ISPermission(Subject subject,
                    CodeSource codesource)
Constructs an 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.

ISPermission

public ISPermission(CodeSource codesource)
Constructs an ISPermission instance, with the specified CodeSource.

パラメータ:
codesource - CodeSource for which this permission is being created.

ISPermission

public ISPermission(String serviceName,
                    String resourceName,
                    String actions)
Constructs an 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 OpenSSO'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.

ISPermission

public ISPermission(String serviceName,
                    String resourceName,
                    String actions,
                    Map envParams)
Constructs an 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.
メソッドの詳細

getServiceName

public String getServiceName()
returns the name of the service associated with this ISPermission .

戻り値:
String representing the name of the service for this permission.

getResourceName

public String getResourceName()
returns the name of the resource associated with this ISPermission .

戻り値:
String representing the name of the resource for this permission.

getEnvParams

public Map getEnvParams()
returns environment parameters and their values associated with this ISPermission.

戻り値:
Map representing the environment parameters of this permission. The Map consists of attribute value pairs.

getActions

public String getActions()
returns a comma separated list of actions associated with this ISPermission.

定義:
クラス Permission 内の getActions
戻り値:
a comma separated 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"
          

getSubject

public Subject getSubject()
returns the Subjectassociated with this ISPermission .

戻り値:
javax.security.auth.Subject representing the subject of this permission.

getCodeSource

public CodeSource getCodeSource()
returns the CodeSourceassociated with this ISPermission.

戻り値:
java.security.CodeSource representing the codesource of this permission.

getProtectionDomain

public ProtectionDomain getProtectionDomain()
returns the ProtectionDomainassociated with this ISPermission.

戻り値:
java.security.ProtectionDomain representing the protectionDomain of this permission.

equals

public boolean equals(Object obj)
Returns true if two ISPermission objects for equality.

定義:
クラス Permission 内の equals
パラメータ:
obj - ISPermission object.
戻り値:
true if subject, codesource, service name, resource name actions and environment parameters of both objects are equal.

hashCode

public int hashCode()
Returns the hash code value for this Permission object.

The required hashCode behavior for Permission Objects is the following:

定義:
クラス Permission 内の hashCode
戻り値:
a hash code value for this object.

implies

public boolean implies(Permission perm)
Checks if the specified permission's actions are "implied by" this object's actions.

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.

定義:
クラス Permission 内の implies
パラメータ:
perm - the permission to check against.
戻り値:
true if the specified permission is implied by this object, false if not. The check is made against the OpenSSO's policy service to determine this evaluation.

newPermissionCollection

public PermissionCollection newPermissionCollection()
Returns a java.security.PermissionCollection to store this kind of Permission.

オーバーライド:
クラス Permission 内の newPermissionCollection
戻り値:
an instance of ISPermissionCollection

toString

public String toString()
Returns a string describing this Permission.

オーバーライド:
クラス Permission 内の toString
戻り値:
String containing information about this Permission.