oracle.dbtools.plugin.api.security

## Interface AuthorizationConstraint

- All Known Subinterfaces:
    EndUserAuthorizationConstraint

      public interface AuthorizationConstraint

  Encapsulates the authorization constraints that restrict access to a given resource.
  Author:
    cdivilly

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `authorized(Principal principal)` Determines if a `Principal` is authorized to access this privilege.
    `AuthenticationChallenge[]` | `challenges()` Returns the authentication `AuthenticationChallenge`s that are bound to this constraint.
    `boolean` | `equals(AuthorizationConstraint constraint)` All `AuthorizationConstraint` implementations MUST implement the `equals(AuthorizationConstraint)` method correctly.
    `boolean` | `equals(Object obj)` All `AuthorizationConstraint` implementations MUST implement the `Object.equals(Object)` method correctly.
    `int` | `hashCode()` All `AuthorizationConstraint` implementations MUST implement the `Object.hashCode()` method correctly.
    `String` | `name()` The unique name assigned to this constraint.

- - ### Method Detail

    - #### name

          String name()

      The unique name assigned to this constraint. It is an error for more than one `AuthorizationConstraint` to share the same name.
      Returns:
        The name

    - #### challenges

          AuthenticationChallenge[] challenges()

      Returns the authentication `AuthenticationChallenge`s that are bound to this constraint.
      Returns:
        Array of `AuthenticationChallenge` instances that the constraint is bound to

    - #### authorized

          boolean authorized(Principal principal)

      Determines if a `Principal` is authorized to access this privilege.
      Parameters:
        `principal` - The `Principal` to test for authorization
      Returns:
        true if the principal is authorized to access the resource, false otherwise

    - #### equals

          boolean equals(Object obj)

      All `AuthorizationConstraint` implementations MUST implement the `Object.equals(Object)` method correctly. Typical implementations of this method should check if the specified object is an instance of `AuthorizationConstraint`. If it is then delegate to `equals(AuthorizationConstraint)`. If not then return false.
      Overrides:
        `equals` in class `Object`
      Parameters:
        `obj` - The object to test for equality.
      Returns:
        true if this instance and the specified instance are equal.
      See Also:
        `equals(AuthorizationConstraint)`

    - #### equals

          boolean equals(AuthorizationConstraint constraint)

      All `AuthorizationConstraint` implementations MUST implement the `equals(AuthorizationConstraint)` method correctly. Typical implementations of this method should check if the specified object is an instance of the same sub-type of `AuthorizationConstraint`. If it is then compare each of the properties of the sub-type for equality. If it is not of the same sub-type then return false.
      Parameters:
        `constraint` - The `AuthorizationConstraint` to test for equality
      Returns:
        true if this instance and the specified instance are equal.

    - #### hashCode

          int hashCode()

      All `AuthorizationConstraint` implementations MUST implement the `Object.hashCode()` method correctly.
      Overrides:
        `hashCode` in class `Object`
      See Also:
        `Object.hashCode()`

Copyright © 2010, 2022, Oracle and/or its affiliates.