Options
All
  • Public
  • Public/Protected
  • All
Menu

Verifies that the id param of a route is a valid oid of a student nation

Hierarchy

  • default

Index

Constructors

constructor

Methods

handle

  • handle(__namedParameters: HttpContextContract, next: () => Promise<void>, scopes: string[]): Promise<void>
  • Handle request

    Parameters

    • __namedParameters: HttpContextContract
    • next: () => Promise<void>
        • (): Promise<void>
        • Returns Promise<void>

    • scopes: string[]

    Returns Promise<void>

Private isAdmin

  • isAdmin(oid: number, user: default): boolean
  • Verify if the user is part of the nation it wants to operate within AND is an admin user

    Parameters

    Returns boolean

Private isStaff

  • isStaff(oid: number, __namedParameters: default): boolean

Private throwUnauthorized

  • throwUnauthorized(): void
  • If the user is unathorized to perform a given action, throw {@link AuthenticationException}

    Returns void

Private verifyScope

  • verifyScope(oid: number, user: default, scopes: string[]): Promise<void>
  • Verify the scopes for a given user

    Parameters

    • oid: number

      The nation id to verify within

    • user: default

      The user to control its user priviliges

    • scopes: string[]

      The scopes to check within

      NationOwnerScopes for more info about the scopes

    Returns Promise<void>

Generated using TypeDoc