Setu-TS
    Preparing search index...

    Function createDatabaseGrantSource

    • Builds a scoped RBAC grant source over a repository: one row per grant, scopeType/scopeId both null for a global grant.

      A chain question is ONE query — the subject, and the scope in the chain or global; an all question (sign-in timing) reads every row of the subject.

      Parameters

      Returns RegistryFactory<IGrantSource>

      A factory AuthPlugin resolves in onInit

      When the entity, a field name or the limit is invalid

      AuthPlugin({
      rbac: { roles: { approver: { permissions: ['invoices:approve'] } } },
      scopedRbac: {
      sources: [{ kind: 'custom', source: createDatabaseGrantSource({ entity: 'grants' }) }],
      },
      });

      0.9.0