Stone.js API
    Preparing search index...
    • Class decorator: decide what an authenticated caller may do, declaratively.

      @Authz() registers the authorization service provider (so constructor ({ authz }) works anywhere) and the kernel middleware that builds the caller's abilities for the request. It answers what a caller may do; @Auth() answers who the caller is, and the two are usually enabled together.

      The declarative half of the pair; authzBlueprint handed to defineStoneApp is the imperative one.

      Type Parameters

      • T extends ClassType = ClassType

      Parameters

      Returns ClassDecorator

      A class decorator.

      import { Authz } from '@stone-js/authz'

      @Authz({ resolveAbility: ({ user }) => buildAbilityFor(user) })
      @StoneApp({ name: 'my-app' })
      export class Application {}