Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RoleBasedAuthorization

Represents a role. Note that this role can optionally be assigned to a specific resource

Hierarchy

Index

Methods

getResource

  • getResource(): string
  • returns an optional resource that the role is assigned-on

    Returns string

getRole

  • getRole(): string
  • returns the role

    Returns string

match

  • this methods verifies whether or not the authorization match the specified context.

    Parameters

    Returns boolean

  • 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 {@link Authorization#match}

    Parameters

    Returns boolean

setResource

  • sets an optional resource that the role is assigned-on

    Parameters

    • resource: string

    Returns RoleBasedAuthorization

verify

  • 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

    Parameters

    Returns boolean

Static create

  • Parameters

    • role: string

    Returns RoleBasedAuthorization

Generated using TypeDoc