Libraries
    Preparing search index...

    Type Alias ScopedEndpointFactory<TRoles>

    ScopedEndpointFactory: ScopedEndpointFactoryMethods<undefined, TRoles> & {
        authorize<TSchema extends SchemaBuilder<any, any, any, any, any>>(
            principalSchema: TSchema,
            ...roles: TRoles[],
        ): ScopedEndpointFactoryMethods<InferType<TSchema>, TRoles>;
        authorize(
            ...roles: TRoles[],
        ): ScopedEndpointFactoryMethods<unknown, TRoles>;
        public(): ScopedEndpointFactoryMethods<TRoles>;
    }

    Type Parameters

    • TRoles extends string = string

    Type Declaration

    • authorize: function
      • Returns a new resource factory where all endpoints inherit the given authorization requirements.

        • authorize(principalSchema, ...roles) — typed principal
        • authorize(...roles) — untyped principal

        Type Parameters

        Parameters

        • principalSchema: TSchema
        • ...roles: TRoles[]

        Returns ScopedEndpointFactoryMethods<InferType<TSchema>, TRoles>

      • Parameters

        Returns ScopedEndpointFactoryMethods<unknown, TRoles>

    • public: function