Setu-TS
    Preparing search index...

    Function ScopedPermissions

    • Requires the principal to hold ALL of the given catalogue permissions in the request's scope — through a catalogue role, a per-scope custom role, or its own permissions. May be applied at the class or method level (method overrides class). Answers 501/401/403 as ScopedRoles does.

      Parameters

      • permissions: readonly string[]

        The permissions, all of which are required

      • Optionalscope: ScopeSource

        Where the scope comes from (default: the request tenant)

      Returns SetuClassOrMethodDecorator

      A class or method decorator

      When permissions is empty or holds a non-string

      @Get('/orgs/:orgId/reports')
      @ScopedPermissions(['reports:read'], scopeFromParam('orgId', 'organisation'))
      reports() { … }

      0.9.0