Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JAAS Provider Java API Reference 10g (9.0.4.0.0) B10389-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.security.jazn.policy
Class AdminPermission

    java.lang.Object
      |
      +--java.security.Permission
            |
            +--oracle.security.jazn.policy.AdminPermission

All Implemented Interfaces:
  Guard, Serializable

public class AdminPermission
extends Permission

This class represents the right to administer a permission.

Given a Permission `p`, the grantee of `AdminPermission(p)` is granted the right to:

- grant/revoke permissions implied by p (say p')
- grant/revoke AdminPermission(p')

For examples:

p = java.io.FilePermission("/home/scott/-","read,write");

if grantee SCOTT is granted AdminPermission(p),
then SCOTT is granted the following rights:

- the right to further grant/revoke p' (i.e. read and write privileges for any file(s) in the file system under "/home/scott") to/from other grantees
- the right to further grant/revoke AdminPermission(p')

Notes:

- An AdminPermission embedding another AdminPermission is not supported. There is furthermore no need to do so since granting a grantee AdminPermission(p) implies that the grantee can further grant/revoke AdminPermission(p')
- Granting a grantee AdminPermission(p) does not imply granting the grantee p - that needs to be granted separately.

See Also:
  Serialized Form

Constructor Summary
`AdminPermission(Permission p)` Creates a new `AdminPermission` instance.
`AdminPermission(String name)` Create a new `AdminPermission` instance.
`AdminPermission(String name, String actions)` Create a new `AdminPermission` instance.

Method Summary
`boolean` | `equals(Object o)` Checks two `AdminPermission` objects for equality.
`String` | `getActions()` Returns the canonical string representation of the actions, which currently is the empty string "", since there are no actions for an `AdminPermission`.
`Permission` | `getEmbeddedPermission()` Returns the permission whose administrative right is to be granted.
`int` | `hashCode()` Returns the hash code value for this object.
`boolean` | `implies(Permission p)` Checks if the specified permission is "implied" by this object.

Methods inherited from class java.security.Permission
`checkGuard, getName, newPermissionCollection, toString`

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### AdminPermission

    public AdminPermission(String name)

  Create a new `AdminPermission` instance.
Parameters:
  `name` - the encoded permission string Note that the encoded permission cannot be an `AdminPermission` instance.

### AdminPermission

    public AdminPermission(String name,
    String actions)

  Create a new `AdminPermission` instance.
Parameters:
  `name` - the encoded permission string Note that the encoded permission cannot be an `AdminPermission` instance.
  `actions` - the actions associated with this permission instance. This parameter is currently ignored.

### AdminPermission

    public AdminPermission(Permission p)

  Creates a new `AdminPermission` instance.

Method Detail

### getActions

    public String getActions()

  Returns the canonical string representation of the actions, which currently is the empty string "", since there are no actions for an `AdminPermission`.
  Specified by:
    `getActions` in class `Permission`
  Returns:
    the empty string "".

### hashCode

    public int hashCode()

  Returns the hash code value for this object. The hash code used is the hash code of the name, that is, `getName().hashCode()`, where `getName` is from the Permission superclass.
  Specified by:
    `hashCode` in class `Permission`
  Returns:
    a hash code value for this object.

### equals

    public boolean equals(Object o)

  Checks two `AdminPermission` objects for equality. Checks that obj's class is the same as this object's class and has the same embedded permission as this object.
  Specified by:
    `equals` in class `Permission`
  Returns:
    true if obj is an `AdminPermission`, and has the same embedded permission as this `AdminPermission` object, false otherwise.

### getEmbeddedPermission

    public Permission getEmbeddedPermission()

  Returns the permission whose administrative right is to be granted.
  Returns:
    the permission whose administrative right is to be granted.

### implies

    public boolean implies(Permission p)

  Checks if the specified permission is "implied" by this object.

  More specifically, this method returns true if:

  - p's class is the same as this object's class, and
  - p's name equals or is implied by this object's name.
  Specified by:
    `implies` in class `Permission`
  Parameters:
    `p` - the permission to check against.
  Returns:
    true if the passed permission is equal to or implied by this permission, false otherwise.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JAAS Provider Java API Reference 10g (9.0.4.0.0) B10389-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2002, 2003 Oracle Corporation. All Rights Reserved.