Class PermissionBasedAuthorization

java.lang.Object
io.vertx.rxjava3.ext.auth.authorization.PermissionBasedAuthorization
All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate, Authorization

public class PermissionBasedAuthorization extends Object implements io.vertx.lang.rx.RxDelegate, Authorization
Represents a permission Note that the permission can optionally be assigned to a specific resource

NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.

  • Field Details

  • Constructor Details

    • PermissionBasedAuthorization

      public PermissionBasedAuthorization(PermissionBasedAuthorization delegate)
    • PermissionBasedAuthorization

      public PermissionBasedAuthorization(Object delegate)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getDelegate

      public PermissionBasedAuthorization getDelegate()
      Specified by:
      getDelegate in interface Authorization
      Specified by:
      getDelegate in interface io.vertx.lang.rx.RxDelegate
    • match

      public boolean match(AuthorizationContext context)
      this methods verifies whether or not the authorization match the specified context.
      Specified by:
      match in interface Authorization
      Parameters:
      context - the context.
      Returns:
      true if there's a match.
    • verify

      public boolean verify(Authorization authorization)
      this method verifies whether or not the authorization implies the specified authorization.
      Note that it doesn't always mean an exact match. For instance, in the case of a WildcardPermissionBasedAuthorization, this method may return true even if the permissions are different
      WildcardPermissionBasedAuthorization.create('*').verify(WildcardPermissionBasedAuthorization.create('anypermission')) would return true
      Specified by:
      verify in interface Authorization
      Parameters:
      authorization - the authorization.
      Returns:
      true if implies the argument.
    • toJson

      public JsonObject toJson()
      Specified by:
      toJson in interface Authorization
    • create

      public static PermissionBasedAuthorization create(String permission)
    • getPermission

      public String getPermission()
      returns the value of the permission
      Returns:
    • getResource

      public String getResource()
      returns an optional resource that the permission is assigned-on
      Returns:
    • setResource

      public PermissionBasedAuthorization setResource(String resource)
      sets an optional resource that the permission is assigned-on
      Parameters:
      resource -
      Returns:
    • match

      public boolean match(User user)
      this methods verifies whether or not the authorization match the specified user. Internally a basic context is created with the user and the method delegates to Authorization.match(AuthorizationContext)
      Parameters:
      user - the user.
      Returns:
      true if there's a match
    • newInstance