Member Junction
    Preparing search index...
    • Decorator-style function for common scope checks. Returns a function that can be used in resolvers.

      Parameters

      • scopePath: string

        The scope path required

      • options: Omit<ScopeAuthOptions, "resource"> = {}

        Additional options

      Returns (
          ctx: { userPayload: { apiKeyId?: string; userRecord: UserInfo } },
          resource?: string,
      ) => Promise<void>

      A function that performs the scope check

      const requireViewRun = RequireScope('view:run');

      // In resolver
      async runView(@Ctx() ctx: AppContext): Promise<ViewResult> {
      await requireViewRun(ctx);
      // ... proceed
      }