• Is user organization role owner or admin for invitations validator

    Parameters

    • Rest ...ts: [opts: {
          authSecrets: AuthSecrets;
          authenticate: AuthenticationFunction;
          invitationService: Pick<InvitationDataService, "getInvitation">;
          organizationAPI: Pick<OrganizationDefaultAdapterAPI, "getUserOrganizations">;
          targetField: TargetField;
      }, logger: Logger, context: AdapterHandlerContext]

    Returns Promise<StatusCodes>

    200 Status OK

    Description

    This validator will check if user has an owner or admin organization role for invitations by applying the following steps in sequence:

    1. Get invitation id from target field

    2. Get invitation from invitationService

    3. Make sure orgId exists in invitation

    4. Use orgId to check if user is in organization roles

    5. Return check result

    Throws

    401 NBError Unauthorized

    • error parsing user token ${error.message}

    Throws

    403 NBError Forbidden

    • cannot find parameter in ${targetField.type} ${targetField.name}

Generated using TypeDoc