Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Oracle Application Server JAAS Provider API Reference 10g Release 3 (10.1.3) B25710-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.security.jazn.policy
Interface JAZNPolicy

All Known Subinterfaces:
  GlobalPolicy, RealmPolicy

public interface JAZNPolicy

An Policy object represents the repository of authorization policies. <p/> To be more precise, the policy deals with the assignment of permissions or privileges to grantees (which can be users or roles or any valid `Grantee`). <p/> Granting/Revoking Policies <p/> In order for a grant/revocation to succeed, the grantor/revoker (represented by the current Subject) must have the relevant permissions granted to him/her. <p/> Policy Snapshot <p/> In general the methods that return a list or set represents a snapshot of the policy store at the time of query. If the policy store is further modified, the returned set of permissions/roles may no longer be valid. <p/> Policy Cache <p/> In general the Policy implementation should cache the policy information, so that repeated calls using the same parameters do not result in repeated network roundtrips to the backing store. <p/> This interface also defines methods that change the persistent state of the policy store (e.g. grant/revokeXXX methods). The implementation should take care to ensure that whenever a grant/revoke is effected the relevant cache entries are invalidated. <p/>

Author:
  rkng

Method Summary
`java.security.PermissionCollection` | `getPermissions(java.security.CodeSource codesource)` Evaluates the global policy and returns a PermissionCollection object specifying the set of permissions allowed for code from the specified code source.
`java.security.PermissionCollection` | `getPermissions(Grantee grantee, java.lang.Class perm_cls)` Lists all permissions of the specified `Class` granted to this grantee.
`java.security.PermissionCollection` | `getPermissions(java.security.ProtectionDomain domain)` Evaluates the global policy and returns a PermissionCollection object specifying the set of permissions allowed given the characteristics of the protection domain.
`java.security.PermissionCollection` | `getPermissions(javax.security.auth.Subject subject, java.security.CodeSource cs)` Retrieve the Permissions granted to the Principals associated with the specified `CodeSource`.
`void` | `grant(Grantee grantee, java.security.Permission perm)` Grants a permission to the specified grantee, optionally with admin option.
`boolean` | `hasPermission(Grantee grantee, java.security.Permission perm)` Returns `true` if the grantee in question can assume the specified permission.
`void` | `refresh()` Refresh and reload the Policy
`void` | `revoke(Grantee grantee, java.security.Permission perm)` Revokes the permission from the specified grantee

Method Detail

### grant

    public void grant(Grantee grantee,
                      java.security.Permission perm)
               throws JAZNException

  Grants a permission to the specified grantee, optionally with admin option.
  Parameters:
    `grantee` - the grantee to be granted the specified permission
    `perm` - the permission to be granted
  Throws:
    `JAZNException` - if a JAZN exception is encountered.
    `java.lang.SecurityException` - if the caller does not have the permission to invoke this method

### revoke

    public void revoke(Grantee grantee,
                       java.security.Permission perm)
                throws JAZNException

  Revokes the permission from the specified grantee
  Parameters:
    `grantee` - the specified grantee
    `perm` - the specified permission to be revoked
  Throws:
    `JAZNException` - if a JAZN exception is encountered.
    `java.lang.SecurityException` - if the caller does not have the permission to invoke this method

### getPermissions

    public java.security.PermissionCollection getPermissions(Grantee grantee,
                                                             java.lang.Class perm_cls)
                                                      throws JAZNException

  Lists all permissions of the specified `Class` granted to this grantee.
  Parameters:
    `grantee` - the grantee in question
    `perm_cls` - the permission `Class` of which the returning permissions will be instances of
  Returns:
    permissions of the specified class granted to the specified grantee
  Throws:
    `java.lang.SecurityException` - if the caller does not have the permission required to invoke this method.
    `JAZNException`

### hasPermission

    public boolean hasPermission(Grantee grantee,
                                 java.security.Permission perm)
                          throws JAZNException

  Returns `true` if the grantee in question can assume the specified permission.
  Parameters:
    `grantee` - the grantee in question
    `perm` - the specified permission
  Returns:
    `true` if the grantee in question can assume the specified permission.
  Throws:
    `java.lang.SecurityException` - if the caller does not have the permission required to invoke this method.
    `JAZNException`

### getPermissions

    public java.security.PermissionCollection getPermissions(javax.security.auth.Subject subject,
                                                             java.security.CodeSource cs)

  Retrieve the Permissions granted to the Principals associated with the specified `CodeSource`.
  Parameters:
    `subject` - the `Subject` whose associated Principals, in conjunction with the provided `CodeSource`, determines the Permissions returned by this method. This parameter may be `null`.
    `cs` - the code specified by its `CodeSource` that determines, in conjunction with the provided `Subject`, the Permissions returned by this method. This parameter may be `null`.
  Returns:
    the Collection of Permissions granted to all the `Subject` and code specified in the provided subject and cs parameters.
  See Also:
    `Policy`

### getPermissions

    public java.security.PermissionCollection getPermissions(java.security.CodeSource codesource)

  Evaluates the global policy and returns a PermissionCollection object specifying the set of permissions allowed for code from the specified code source.
  Parameters:
    `codesource` - the CodeSource associated with the caller. This encapsulates the original location of the code (where the code came from) and the public key(s) of its signer.
  Returns:
    the set of permissions allowed for code from codesource according to the policy.
  Throws:
    `java.lang.SecurityException` - if the current thread does not have permission to call `getPermissions` on the policy object.
  See Also:
    `Policy`

### getPermissions

    public java.security.PermissionCollection getPermissions(java.security.ProtectionDomain domain)

  Evaluates the global policy and returns a PermissionCollection object specifying the set of permissions allowed given the characteristics of the protection domain.
  Parameters:
    `domain` - the ProtectionDomain associated with the caller.
  Returns:
    the set of permissions allowed for the domain according to the policy.The returned set of permissions must be a new mutable instance and it must support heterogeneous Permission types.
  Since:
    1.4
  See Also:
    `ProtectionDomain`, `SecureClassLoader`

### refresh

    public void refresh()

  Refresh and reload the Policy
  Throws:
    `java.lang.SecurityException` - if the caller does not have permission to refresh the Policy.
  See Also:
    `Policy`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Oracle Application Server JAAS Provider API Reference 10g Release 3 (10.1.3) B25710-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004, 2006, Oracle. All rights reserved.