@lastshotlabs/slingshot-permissions
npm install @lastshotlabs/slingshot-permissions
Functions
Section titled “Functions”createAuthGroupResolver
Section titled “createAuthGroupResolver”Creates a GroupResolver backed by a Slingshot auth runtime when one is available.
The returned resolver is lazy: it reads the current runtime on each call so it can be
created before the auth plugin has populated pluginState. When auth is unavailable or
the adapter does not implement group lookups, the resolver returns an empty set.
function createAuthGroupResolver(getRuntime: () => AuthLikeRuntime | null | undefined,): GroupResolverSource: packages/slingshot-permissions/src/lib/authGroupResolver.ts
createEvaluationCache
Section titled “createEvaluationCache”TTL-based evaluation cache for permission checks.
Caches the boolean result of evaluator.can() calls keyed by
(subjectId + subjectType + action + tenantId + resourceType + resourceId).
On cache hit within the configured TTL the cached value is returned
without hitting the backing adapter.
Use invalidate() after permission changes (grant create/revoke/delete)
to bust the entire cache, or invalidateForActor(actorId) to bust only
entries for a specific subject.
function createEvaluationCache(options?: EvaluationCacheOptions): EvaluationCacheSource: packages/slingshot-permissions/src/lib/evaluationCache.ts
createMemoryAuditTrailStore
Section titled “createMemoryAuditTrailStore”Audit trail for permission changes.
Records every create / update / delete operation performed through a
PermissionsAdapter so that operators and compliance tooling can answer
“who changed what and when”.
The audit trail is opt-in: create an AuditTrailStore, then wrap your
adapter with withAuditTrail().
function createMemoryAuditTrailStore(options?: MemoryAuditTrailStoreOptions,): AuditTrailStoreSource: packages/slingshot-permissions/src/lib/auditTrail.ts
createMemoryPermissionsAdapter
Section titled “createMemoryPermissionsAdapter”Alias for TestablePermissionsAdapter returned by createMemoryPermissionsAdapter.
Exposes the clear() method for resetting state between tests.
function createMemoryPermissionsAdapter(options?: { maxEntries?: number; }): PermissionsMemoryAdapterSource: packages/slingshot-permissions/src/adapters/memory.ts
createMongoPermissionsAdapter
Section titled “createMongoPermissionsAdapter”MongoDB document shape for a PermissionGrant.
_id is a UUID string rather than an ObjectId to align with the cross-adapter ID convention.
function createMongoPermissionsAdapter(conn: MongoConnectionLike): PermissionsMongoAdapterSource: packages/slingshot-permissions/src/adapters/mongo.ts
createPermissionEvaluator
Section titled “createPermissionEvaluator”Health snapshot describing the evaluator’s recent error and timeout activity.
Cross-package consumers should read this snapshot through PermissionsHealthCap
rather than calling getHealth() directly; the capability is the canonical
public surface and the local getHealth() is what the package uses to
populate it.
All fields are cumulative counters since evaluator creation; consumers track deltas to compute rates if needed.
function createPermissionEvaluator(config: EvaluatorConfig): EvaluatorWithHealthSource: packages/slingshot-permissions/src/lib/evaluator.ts
createPermissionRegistry
Section titled “createPermissionRegistry”Creates an in-memory PermissionRegistry for registering resource type definitions.
The registry maps resource types (e.g. 'posts', 'admin:billing') to their allowed
roles and the actions each role grants. Once registered, a resource type is immutable —
re-registration throws to enforce clean domain ownership.
The super-admin role (SUPER_ADMIN_ROLE) always returns ['*'] for any resource type,
regardless of what is registered.
function createPermissionRegistry(): PermissionRegistrySource: packages/slingshot-permissions/src/lib/registry.ts
createPermissionsPackage
Section titled “createPermissionsPackage”Configuration for the permissions package.
Controls the backing adapter, optional group expansion, and evaluator limits used when resolving role grants for user, group, and service-account subjects.
function createPermissionsPackage(rawConfig?: PermissionsPluginConfig,): SlingshotPackageDefinitionSource: packages/slingshot-permissions/src/plugin.ts
createPermissionsPostgresAdapter
Section titled “createPermissionsPostgresAdapter”A scalar value type accepted as a parameterised query parameter by pg.
async function createPermissionsPostgresAdapter(pool: PoolLike, options?: CreatePermissionsPostgresAdapterOptions,): Promise< PermissionsPostgresAdapter &Source: packages/slingshot-permissions/src/adapters/postgres.ts
createSqlitePermissionsAdapter
Section titled “createSqlitePermissionsAdapter”A single synchronous schema migration function that receives an open
RuntimeSqliteDatabase and executes DDL statements via db.run().
Remarks: Never edit or reorder existing entries — append new migrations to the end of MIGRATIONS only.
function createSqlitePermissionsAdapter(db: RuntimeSqliteDatabase,): PermissionsSqliteAdapterSource: packages/slingshot-permissions/src/adapters/sqlite.ts
Permissions
Section titled “Permissions”Public contract for slingshot-permissions.
The package publishes four typed capabilities at boot:
PermissionsEvaluatorCap— answerscan()queriesPermissionsRegistryCap— resource-type registry for role → action mappingsPermissionsAdapterCap— persistence adapter for grantsPermissionsHealthCap— aggregated health snapshot
Cross-package consumers resolve them via ctx.capabilities.require(...) instead of
reaching into PERMISSIONS_RUNTIME_KEY directly.
Source: packages/slingshot-permissions/src/public.ts
PermissionsAdapterCap
Section titled “PermissionsAdapterCap”Public contract for slingshot-permissions.
The package publishes four typed capabilities at boot:
PermissionsEvaluatorCap— answerscan()queriesPermissionsRegistryCap— resource-type registry for role → action mappingsPermissionsAdapterCap— persistence adapter for grantsPermissionsHealthCap— aggregated health snapshot
Cross-package consumers resolve them via ctx.capabilities.require(...) instead of
reaching into PERMISSIONS_RUNTIME_KEY directly.
Source: packages/slingshot-permissions/src/public.ts
permissionsAdapterFactories
Section titled “permissionsAdapterFactories”A record that maps every StoreType to a factory function producing a
PermissionsAdapter from StoreInfra. Pass to the framework’s adapter resolution
machinery so the correct backend is selected at startup.
Remarks: redis is rejected because there is no Redis permissions adapter.
Source: packages/slingshot-permissions/src/factories.ts
PermissionsEvaluatorCap
Section titled “PermissionsEvaluatorCap”Public contract for slingshot-permissions.
The package publishes four typed capabilities at boot:
PermissionsEvaluatorCap— answerscan()queriesPermissionsRegistryCap— resource-type registry for role → action mappingsPermissionsAdapterCap— persistence adapter for grantsPermissionsHealthCap— aggregated health snapshot
Cross-package consumers resolve them via ctx.capabilities.require(...) instead of
reaching into PERMISSIONS_RUNTIME_KEY directly.
Source: packages/slingshot-permissions/src/public.ts
PermissionsHealthCap
Section titled “PermissionsHealthCap”Public contract for slingshot-permissions.
The package publishes four typed capabilities at boot:
PermissionsEvaluatorCap— answerscan()queriesPermissionsRegistryCap— resource-type registry for role → action mappingsPermissionsAdapterCap— persistence adapter for grantsPermissionsHealthCap— aggregated health snapshot
Cross-package consumers resolve them via ctx.capabilities.require(...) instead of
reaching into PERMISSIONS_RUNTIME_KEY directly.
Source: packages/slingshot-permissions/src/public.ts
PermissionsRegistryCap
Section titled “PermissionsRegistryCap”Public contract for slingshot-permissions.
The package publishes four typed capabilities at boot:
PermissionsEvaluatorCap— answerscan()queriesPermissionsRegistryCap— resource-type registry for role → action mappingsPermissionsAdapterCap— persistence adapter for grantsPermissionsHealthCap— aggregated health snapshot
Cross-package consumers resolve them via ctx.capabilities.require(...) instead of
reaching into PERMISSIONS_RUNTIME_KEY directly.
Source: packages/slingshot-permissions/src/public.ts
seedSuperAdmin
Section titled “seedSuperAdmin”Seeds a super-admin grant for the given subject using the SUPER_ADMIN_ROLE.
The grant is global (no tenant, no resource) so it applies everywhere. This function is idempotent — if the subject already holds an active super-admin grant it returns that grant’s ID without creating a duplicate. Safe to call on every deployment.
async function seedSuperAdmin(adapter: PermissionsAdapter, opts: { subjectId: string; subjectType?: SubjectType; grantedBy?: string },): Promise<string>Source: packages/slingshot-permissions/src/lib/bootstrap.ts
SUPER_ADMIN_ROLE
Section titled “SUPER_ADMIN_ROLE”The type of entity a permission grant applies to.
'user'— a concrete end-user identity;subjectIdis the user’s primary key as stored in the auth adapter (e.g. a UUID or nanoid)'group'— a named collection of users resolved at evaluation time viaGroupResolver;subjectIdis the group’s ID; grants to a group apply to all current members'service-account'— a non-human M2M client or API service identity;subjectIdis the service account’s client ID or name; used for backend-to-backend trust grants that should not be confused with end-user permissions
Source: packages/slingshot-core/src/permissions.ts
validateGrant
Section titled “validateGrant”The type of entity a permission grant applies to.
'user'— a concrete end-user identity;subjectIdis the user’s primary key as stored in the auth adapter (e.g. a UUID or nanoid)'group'— a named collection of users resolved at evaluation time viaGroupResolver;subjectIdis the group’s ID; grants to a group apply to all current members'service-account'— a non-human M2M client or API service identity;subjectIdis the service account’s client ID or name; used for backend-to-backend trust grants that should not be confused with end-user permissions
function validateGrant(grant: Omit<PermissionGrant, 'id' | 'grantedAt'>): voidSource: packages/slingshot-core/src/permissions.ts
withAuditTrail
Section titled “withAuditTrail”Audit trail for permission changes.
Records every create / update / delete operation performed through a
PermissionsAdapter so that operators and compliance tooling can answer
“who changed what and when”.
The audit trail is opt-in: create an AuditTrailStore, then wrap your
adapter with withAuditTrail().
function withAuditTrail(adapter: PermissionsAdapter, store: AuditTrailStore, options?: WithAuditTrailOptions,): PermissionsAdapterSource: packages/slingshot-permissions/src/lib/auditTrail.ts
Classes
Section titled “Classes”PermissionQueryTimeoutError
Section titled “PermissionQueryTimeoutError”Health snapshot describing the evaluator’s recent error and timeout activity.
Cross-package consumers should read this snapshot through PermissionsHealthCap
rather than calling getHealth() directly; the capability is the canonical
public surface and the local getHealth() is what the package uses to
populate it.
All fields are cumulative counters since evaluator creation; consumers track deltas to compute rates if needed.
Source: packages/slingshot-permissions/src/lib/evaluator.ts
PermissionsAdapterError
Section titled “PermissionsAdapterError”Errors thrown by the permissions plugin.
Source: packages/slingshot-permissions/src/errors.ts
PermissionsConfigError
Section titled “PermissionsConfigError”Errors thrown by the permissions plugin.
Source: packages/slingshot-permissions/src/errors.ts
PermissionsError
Section titled “PermissionsError”Errors thrown by the permissions plugin.
Source: packages/slingshot-permissions/src/errors.ts
Interfaces
Section titled “Interfaces”AuditTrailEntry
Section titled “AuditTrailEntry”Audit trail for permission changes.
Records every create / update / delete operation performed through a
PermissionsAdapter so that operators and compliance tooling can answer
“who changed what and when”.
The audit trail is opt-in: create an AuditTrailStore, then wrap your
adapter with withAuditTrail().
Source: packages/slingshot-permissions/src/lib/auditTrail.ts
AuditTrailFilter
Section titled “AuditTrailFilter”Audit trail for permission changes.
Records every create / update / delete operation performed through a
PermissionsAdapter so that operators and compliance tooling can answer
“who changed what and when”.
The audit trail is opt-in: create an AuditTrailStore, then wrap your
adapter with withAuditTrail().
Source: packages/slingshot-permissions/src/lib/auditTrail.ts
AuditTrailStore
Section titled “AuditTrailStore”Audit trail for permission changes.
Records every create / update / delete operation performed through a
PermissionsAdapter so that operators and compliance tooling can answer
“who changed what and when”.
The audit trail is opt-in: create an AuditTrailStore, then wrap your
adapter with withAuditTrail().
Source: packages/slingshot-permissions/src/lib/auditTrail.ts
CreatePermissionsPostgresAdapterOptions
Section titled “CreatePermissionsPostgresAdapterOptions”A scalar value type accepted as a parameterised query parameter by pg.
Source: packages/slingshot-permissions/src/adapters/postgres.ts
EvaluationCache
Section titled “EvaluationCache”TTL-based evaluation cache for permission checks.
Caches the boolean result of evaluator.can() calls keyed by
(subjectId + subjectType + action + tenantId + resourceType + resourceId).
On cache hit within the configured TTL the cached value is returned
without hitting the backing adapter.
Use invalidate() after permission changes (grant create/revoke/delete)
to bust the entire cache, or invalidateForActor(actorId) to bust only
entries for a specific subject.
Source: packages/slingshot-permissions/src/lib/evaluationCache.ts
EvaluationCacheEntry
Section titled “EvaluationCacheEntry”TTL-based evaluation cache for permission checks.
Caches the boolean result of evaluator.can() calls keyed by
(subjectId + subjectType + action + tenantId + resourceType + resourceId).
On cache hit within the configured TTL the cached value is returned
without hitting the backing adapter.
Use invalidate() after permission changes (grant create/revoke/delete)
to bust the entire cache, or invalidateForActor(actorId) to bust only
entries for a specific subject.
Source: packages/slingshot-permissions/src/lib/evaluationCache.ts
EvaluationCacheOptions
Section titled “EvaluationCacheOptions”TTL-based evaluation cache for permission checks.
Caches the boolean result of evaluator.can() calls keyed by
(subjectId + subjectType + action + tenantId + resourceType + resourceId).
On cache hit within the configured TTL the cached value is returned
without hitting the backing adapter.
Use invalidate() after permission changes (grant create/revoke/delete)
to bust the entire cache, or invalidateForActor(actorId) to bust only
entries for a specific subject.
Source: packages/slingshot-permissions/src/lib/evaluationCache.ts
EvaluatorHealth
Section titled “EvaluatorHealth”Health snapshot describing the evaluator’s recent error and timeout activity.
Cross-package consumers should read this snapshot through PermissionsHealthCap
rather than calling getHealth() directly; the capability is the canonical
public surface and the local getHealth() is what the package uses to
populate it.
All fields are cumulative counters since evaluator creation; consumers track deltas to compute rates if needed.
Source: packages/slingshot-permissions/src/lib/evaluator.ts
EvaluatorLogger
Section titled “EvaluatorLogger”Health snapshot describing the evaluator’s recent error and timeout activity.
Cross-package consumers should read this snapshot through PermissionsHealthCap
rather than calling getHealth() directly; the capability is the canonical
public surface and the local getHealth() is what the package uses to
populate it.
All fields are cumulative counters since evaluator creation; consumers track deltas to compute rates if needed.
Source: packages/slingshot-permissions/src/lib/evaluator.ts
EvaluatorWithHealth
Section titled “EvaluatorWithHealth”Health snapshot describing the evaluator’s recent error and timeout activity.
Cross-package consumers should read this snapshot through PermissionsHealthCap
rather than calling getHealth() directly; the capability is the canonical
public surface and the local getHealth() is what the package uses to
populate it.
All fields are cumulative counters since evaluator creation; consumers track deltas to compute rates if needed.
Source: packages/slingshot-permissions/src/lib/evaluator.ts
GroupExpansionFailure
Section titled “GroupExpansionFailure”Health snapshot describing the evaluator’s recent error and timeout activity.
Cross-package consumers should read this snapshot through PermissionsHealthCap
rather than calling getHealth() directly; the capability is the canonical
public surface and the local getHealth() is what the package uses to
populate it.
All fields are cumulative counters since evaluator creation; consumers track deltas to compute rates if needed.
Source: packages/slingshot-permissions/src/lib/evaluator.ts
GroupResolver
Section titled “GroupResolver”The type of entity a permission grant applies to.
'user'— a concrete end-user identity;subjectIdis the user’s primary key as stored in the auth adapter (e.g. a UUID or nanoid)'group'— a named collection of users resolved at evaluation time viaGroupResolver;subjectIdis the group’s ID; grants to a group apply to all current members'service-account'— a non-human M2M client or API service identity;subjectIdis the service account’s client ID or name; used for backend-to-backend trust grants that should not be confused with end-user permissions
Source: packages/slingshot-core/src/permissions.ts
MemoryAuditTrailStoreOptions
Section titled “MemoryAuditTrailStoreOptions”Audit trail for permission changes.
Records every create / update / delete operation performed through a
PermissionsAdapter so that operators and compliance tooling can answer
“who changed what and when”.
The audit trail is opt-in: create an AuditTrailStore, then wrap your
adapter with withAuditTrail().
Source: packages/slingshot-permissions/src/lib/auditTrail.ts
PermissionEvaluator
Section titled “PermissionEvaluator”The type of entity a permission grant applies to.
'user'— a concrete end-user identity;subjectIdis the user’s primary key as stored in the auth adapter (e.g. a UUID or nanoid)'group'— a named collection of users resolved at evaluation time viaGroupResolver;subjectIdis the group’s ID; grants to a group apply to all current members'service-account'— a non-human M2M client or API service identity;subjectIdis the service account’s client ID or name; used for backend-to-backend trust grants that should not be confused with end-user permissions
Source: packages/slingshot-core/src/permissions.ts
PermissionGrant
Section titled “PermissionGrant”The type of entity a permission grant applies to.
'user'— a concrete end-user identity;subjectIdis the user’s primary key as stored in the auth adapter (e.g. a UUID or nanoid)'group'— a named collection of users resolved at evaluation time viaGroupResolver;subjectIdis the group’s ID; grants to a group apply to all current members'service-account'— a non-human M2M client or API service identity;subjectIdis the service account’s client ID or name; used for backend-to-backend trust grants that should not be confused with end-user permissions
Source: packages/slingshot-core/src/permissions.ts
PermissionRegistry
Section titled “PermissionRegistry”The type of entity a permission grant applies to.
'user'— a concrete end-user identity;subjectIdis the user’s primary key as stored in the auth adapter (e.g. a UUID or nanoid)'group'— a named collection of users resolved at evaluation time viaGroupResolver;subjectIdis the group’s ID; grants to a group apply to all current members'service-account'— a non-human M2M client or API service identity;subjectIdis the service account’s client ID or name; used for backend-to-backend trust grants that should not be confused with end-user permissions
Source: packages/slingshot-core/src/permissions.ts
PermissionsAdapter
Section titled “PermissionsAdapter”The type of entity a permission grant applies to.
'user'— a concrete end-user identity;subjectIdis the user’s primary key as stored in the auth adapter (e.g. a UUID or nanoid)'group'— a named collection of users resolved at evaluation time viaGroupResolver;subjectIdis the group’s ID; grants to a group apply to all current members'service-account'— a non-human M2M client or API service identity;subjectIdis the service account’s client ID or name; used for backend-to-backend trust grants that should not be confused with end-user permissions
Source: packages/slingshot-core/src/permissions.ts
PermissionsHealth
Section titled “PermissionsHealth”Public contract for slingshot-permissions.
The package publishes four typed capabilities at boot:
PermissionsEvaluatorCap— answerscan()queriesPermissionsRegistryCap— resource-type registry for role → action mappingsPermissionsAdapterCap— persistence adapter for grantsPermissionsHealthCap— aggregated health snapshot
Cross-package consumers resolve them via ctx.capabilities.require(...) instead of
reaching into PERMISSIONS_RUNTIME_KEY directly.
Source: packages/slingshot-permissions/src/public.ts
PermissionsPluginConfig
Section titled “PermissionsPluginConfig”Configuration for the permissions package.
Controls the backing adapter, optional group expansion, and evaluator limits used when resolving role grants for user, group, and service-account subjects.
Source: packages/slingshot-permissions/src/plugin.ts
PermissionsPostgresAdapterHealth
Section titled “PermissionsPostgresAdapterHealth”A scalar value type accepted as a parameterised query parameter by pg.
Source: packages/slingshot-permissions/src/adapters/postgres.ts
ResourceTypeDefinition
Section titled “ResourceTypeDefinition”The type of entity a permission grant applies to.
'user'— a concrete end-user identity;subjectIdis the user’s primary key as stored in the auth adapter (e.g. a UUID or nanoid)'group'— a named collection of users resolved at evaluation time viaGroupResolver;subjectIdis the group’s ID; grants to a group apply to all current members'service-account'— a non-human M2M client or API service identity;subjectIdis the service account’s client ID or name; used for backend-to-backend trust grants that should not be confused with end-user permissions
Source: packages/slingshot-core/src/permissions.ts
SubjectRef
Section titled “SubjectRef”The type of entity a permission grant applies to.
'user'— a concrete end-user identity;subjectIdis the user’s primary key as stored in the auth adapter (e.g. a UUID or nanoid)'group'— a named collection of users resolved at evaluation time viaGroupResolver;subjectIdis the group’s ID; grants to a group apply to all current members'service-account'— a non-human M2M client or API service identity;subjectIdis the service account’s client ID or name; used for backend-to-backend trust grants that should not be confused with end-user permissions
Source: packages/slingshot-core/src/permissions.ts
TestablePermissionsAdapter
Section titled “TestablePermissionsAdapter”The type of entity a permission grant applies to.
'user'— a concrete end-user identity;subjectIdis the user’s primary key as stored in the auth adapter (e.g. a UUID or nanoid)'group'— a named collection of users resolved at evaluation time viaGroupResolver;subjectIdis the group’s ID; grants to a group apply to all current members'service-account'— a non-human M2M client or API service identity;subjectIdis the service account’s client ID or name; used for backend-to-backend trust grants that should not be confused with end-user permissions
Source: packages/slingshot-core/src/permissions.ts
WithAuditTrailOptions
Section titled “WithAuditTrailOptions”Audit trail for permission changes.
Records every create / update / delete operation performed through a
PermissionsAdapter so that operators and compliance tooling can answer
“who changed what and when”.
The audit trail is opt-in: create an AuditTrailStore, then wrap your
adapter with withAuditTrail().
Source: packages/slingshot-permissions/src/lib/auditTrail.ts
AuditAction
Section titled “AuditAction”Audit trail for permission changes.
Records every create / update / delete operation performed through a
PermissionsAdapter so that operators and compliance tooling can answer
“who changed what and when”.
The audit trail is opt-in: create an AuditTrailStore, then wrap your
adapter with withAuditTrail().
Source: packages/slingshot-permissions/src/lib/auditTrail.ts
AuditResourceType
Section titled “AuditResourceType”Audit trail for permission changes.
Records every create / update / delete operation performed through a
PermissionsAdapter so that operators and compliance tooling can answer
“who changed what and when”.
The audit trail is opt-in: create an AuditTrailStore, then wrap your
adapter with withAuditTrail().
Source: packages/slingshot-permissions/src/lib/auditTrail.ts
GrantEffect
Section titled “GrantEffect”The type of entity a permission grant applies to.
'user'— a concrete end-user identity;subjectIdis the user’s primary key as stored in the auth adapter (e.g. a UUID or nanoid)'group'— a named collection of users resolved at evaluation time viaGroupResolver;subjectIdis the group’s ID; grants to a group apply to all current members'service-account'— a non-human M2M client or API service identity;subjectIdis the service account’s client ID or name; used for backend-to-backend trust grants that should not be confused with end-user permissions
Source: packages/slingshot-core/src/permissions.ts
PermissionsAdapterFactories
Section titled “PermissionsAdapterFactories”A record that maps every StoreType to a factory function producing a
PermissionsAdapter from StoreInfra. Pass to the framework’s adapter resolution
machinery so the correct backend is selected at startup.
Remarks: redis is rejected because there is no Redis permissions adapter.
Source: packages/slingshot-permissions/src/factories.ts
PermissionsMongoAdapter
Section titled “PermissionsMongoAdapter”MongoDB document shape for a PermissionGrant.
_id is a UUID string rather than an ObjectId to align with the cross-adapter ID convention.
Source: packages/slingshot-permissions/src/adapters/mongo.ts
PermissionsPostgresAdapter
Section titled “PermissionsPostgresAdapter”A scalar value type accepted as a parameterised query parameter by pg.
Source: packages/slingshot-permissions/src/adapters/postgres.ts
PermissionsSqliteAdapter
Section titled “PermissionsSqliteAdapter”A single synchronous schema migration function that receives an open
RuntimeSqliteDatabase and executes DDL statements via db.run().
Remarks: Never edit or reorder existing entries — append new migrations to the end of MIGRATIONS only.
Source: packages/slingshot-permissions/src/adapters/sqlite.ts
SubjectType
Section titled “SubjectType”The type of entity a permission grant applies to.
'user'— a concrete end-user identity;subjectIdis the user’s primary key as stored in the auth adapter (e.g. a UUID or nanoid)'group'— a named collection of users resolved at evaluation time viaGroupResolver;subjectIdis the group’s ID; grants to a group apply to all current members'service-account'— a non-human M2M client or API service identity;subjectIdis the service account’s client ID or name; used for backend-to-backend trust grants that should not be confused with end-user permissions
Source: packages/slingshot-core/src/permissions.ts