Skip to content

feat(esign): choose which roles and permissions may use each drive - #76

Merged
lorenzocorallo merged 3 commits into
mainfrom
feat/esign-drive-access
Oct 17, 2026
Merged

lorenzocorallo merged 3 commits into
mainfrom
feat/esign-drive-access

Conversation

@lorenzocorallo

Copy link
Copy Markdown
Member

Per-drive access for e-signing (companion: admin PR; needs PoliNetworkOrg/auth#62 and PoliNetworkOrg/auth-kit#2).

  • New table esign_drive_access: for each drive, a request rule (browse it, use its PDFs/folders in a request, see its requests) and a sign rule (be chosen as signer, sign, upload a signed copy). A rule lists roles and permissions; holding any one grants it. Empty rule = today's default (esign:requests:manage / everyone who signs).
  • Requests record the drives they use (source and output; migration 0025 backfills existing ones). Visibility (list all, get, documents), config.drives, drive browsing/import, request creation (signers must qualify), starting a signature and the signed-upload fallback all follow the rules.
  • esign.drive.access / esign.drive.setAccess gated by the new IdP permission esign:drives:manage.
  • Roles and the role/permission catalog come from the IdP snapshot via auth-kit 1.2.0 (index.roles(), index.catalog()).

Draft: @polinetwork/auth-kit is bumped to ^1.2.0, which is published when auth-kit#2 merges; then refresh bun.lock.

Checks: 123 tests (new: rules by role and by permission, default restore, visibility, signer choice, lost access), Postgres smoke extended (drive access upsert), migration tested on a database with requests (backfill incl. cross-drive), tsc, biome.

Each drive can name the roles and permissions allowed to request signatures with it (browse it, use its PDFs and
folders, see its requests) and to be asked to sign its documents. Any listed role or permission grants it; an empty
rule keeps today's default. Requests record the drives they use (backfilled by migration 0025), so visibility, signer
choice and signing follow the rules. esign.drive.access and esign.drive.setAccess, gated by esign:drives:manage,
read and change them.
…snapshot

Uses @polinetwork/auth-kit 1.2.0: drive rules match the user's effective roles, and Signatures › Drives lists the
IdP's roles and permissions. A signer who lost access to a drive can't upload a signed copy either.
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lorenzocorallo
lorenzocorallo marked this pull request as ready for review October 17, 2026 12:08
@lorenzocorallo
lorenzocorallo merged commit 05deb03 into main Oct 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant