• Is roles valid validator

    Parameters

    • authSecrets: AuthSecrets

      authentication secrets

    • authenticate: AuthenticationFunction
    • isOrganizationOwnerChecker: ((orgId, userId) => Promise<boolean>)

      injected function use to check if the user is the organization owner

        • (orgId, userId): Promise<boolean>
        • Parameters

          • orgId: string
          • userId: string

          Returns Promise<boolean>

    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

      request context [headers, body, params, query].

    Returns Promise<number>

    200 Status OK

    Description

    This validator will check if a user with owner role updates the role except owner:

    1. Check user token if user is owner. If user is not owner, return 200

    2. Check if owner id matches user id in body. If user id in body is not owner, return 200

    3. Check if owner updates other than owner in body. If not, return 200 else return 400.

    Throws

    400 NBError Bad Request

    • roles is not supported

Generated using TypeDoc