Setu-TS
    Preparing search index...

    Function scopeFromParam

    • The scope named by a route parameter. Unresolved — so the check denies — when the parameter is absent, empty or too long.

      When the request also has a resolved tenant and type is the tenant scope type, a parameter naming a DIFFERENT tenant is refused by the evaluator, so a caller cannot evaluate another tenant's grants by editing the path.

      Parameters

      • param: string

        The route parameter name (orgId for /orgs/:orgId)

      • type: string

        The scope type the parameter names

      Returns (ctx: IRequestContext) => ScopeRef | undefined

      A scope source

      When param is empty or type is not lowercase kebab-case

      requireScopedRole('admin', { scope: scopeFromParam('orgId', 'organisation') });
      

      0.9.0