Stone.js API
    Preparing search index...

    The authorization service.

    Isomorphic and platform-agnostic: it wraps a CASL ability (built per-principal via the configured resolveAbility) to answer can/cannot and to authorize (throw on denial). RBAC and ABAC are both supported, and the exact same ability can run on the frontend.

    Implements

    Index
    • Assert the principal is allowed, or throw.

      Parameters

      • user: unknown

        The principal.

      • action: string

        The action.

      • subject: Subject

        The subject.

      • Optionalfield: string

        Optional field-level check.

      Returns void

      When the principal is not allowed.

    • Parameters

      • user: unknown

        The principal.

      • action: string

        The action.

      • subject: Subject

        The subject (type or instance).

      • Optionalfield: string

        Optional field-level check.

      Returns boolean

      Whether the principal is allowed.

    • Parameters

      • user: unknown

        The principal.

      • action: string

        The action.

      • subject: Subject

        The subject.

      • Optionalfield: string

        Optional field-level check.

      Returns boolean

      Whether the principal is NOT allowed.