Skip to content

feat(core): Split share and unshare into separate scopes#1980

Closed
everettbu wants to merge 3 commits into
masterfrom
iam-274-split-share-and-unshare-scope
Closed

feat(core): Split share and unshare into separate scopes#1980
everettbu wants to merge 3 commits into
masterfrom
iam-274-split-share-and-unshare-scope

Conversation

@everettbu

Copy link
Copy Markdown

Mirror of n8n-io/n8n#26011
Original author: afitzek


Summary

Splits the single workflow:share / credential:share scope into separate share and unshare scopes (workflow:unshare, credential:unshare). This ensures users can remove existing shares even when the personal space sharing setting (security.personalSpaceSharing) is disabled.

Previously, disabling personal space sharing removed the share scope from the project:personalOwner role, which also prevented unsharing existing resources. Now, the unshare scopes remain in the project:personalOwner base definition regardless of the sharing setting.

Changes:

  • Add workflow:unshare and credential:unshare to the scope registry and all role definitions that have the corresponding share scope
  • Add unshare scopes to PERSONAL_PROJECT_OWNER_SCOPES base definition (not behind the sharing setting toggle)
  • Modify the PUT /workflows/:id/share endpoint to check workflow:share for adding shares and workflow:unshare for removing shares
  • Modify the PUT /credentials/:id/share endpoint to check credential:share for adding shares and credential:unshare for removing shares
  • Add database migration to grant unshare scopes to existing custom roles that have the corresponding share scope

How to test:

  1. Create a custom role with workflow:share scope — verify it also gets workflow:unshare after migration
  2. Disable personal space sharing setting — verify a personal project owner can still remove existing workflow/credential shares but cannot add new ones
  3. Enable personal space sharing setting — verify both sharing and unsharing work

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/IAM-274/split-share-and-unshare-scope

Review / Merge checklist

@everettbu everettbu added n8n team Authored by the n8n team core Enhancement outside /nodes-base and /editor-ui labels Feb 19, 2026
@everettbu
everettbu marked this pull request as ready for review February 20, 2026 13:00
@everettbu
everettbu force-pushed the iam-274-split-share-and-unshare-scope branch from 13ee9fc to 03fa09a Compare February 23, 2026 10:39
@everettbu

Copy link
Copy Markdown
Author

Upstream PR was closed or merged. Code is synced via branch mirror.

@everettbu everettbu closed this Feb 23, 2026
@everettbu
everettbu deleted the iam-274-split-share-and-unshare-scope branch February 23, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants