Skip to content

PersistentAI API Documentation / @persistent-ai/fireflow-vfs / server / checkPermission

Function: checkPermission()

checkPermission(db, userId, workspaceId, permission, options?): Promise<PermissionResult>

Defined in: packages/fireflow-vfs/src/services/acl.ts:136

Check if a user has the required permission for a workspace.

For regular sessions (no appId): checks workspace owner → public → collaborator table. For app-scoped sessions (ffapp_ token, appId present): checks vfsConfig rules in the app registry. Workspace owners and collaborators are never affected by app rules.

Parameters

db

DB

Database connection

userId

string

User ID to check

workspaceId

string

Workspace ID to check access for

permission

Permission

Required permission level

options?

appId?

string

Present when session is app-scoped (ffapp_ token)

requestPath?

string

VFS path being accessed (lakeFS path, no ff:// prefix)

Returns

Promise<PermissionResult>

Permission result with allowed status and lakeFS repo name

Licensed under BUSL-1.1