Repository navigation
feat(core): add Forbid create object and Forbid edit object space permissions - #11149
Open
MichaelUray wants to merge 1 commit into
Open
MichaelUray wants to merge 1 commit into
MichaelUray wants to merge 1 commit into
Conversation
…missions Space type roles could only forbid deleting objects. Add two more space-scoped forbid permissions, 'Forbid create object' (TxCreateDoc) and 'Forbid edit object' (TxUpdateDoc, which also covers mixin attribute updates), and offer them in all space types that already offer 'Forbid delete object'. They are enforced server-side by SpacePermissionsMiddleware like the existing forbid permission and apply to all objects inside the space, including comments and attachments. Two adjustments in the middleware: - these generic create/update forbids are not applied to the space document itself, so role holders can still manage members, role assignments and archiving of the space; - when several matching permissions without txMatch apply, a forbidding one now wins instead of depending on the role/permission order. On the client, canCreateObject and canChangeDoc (used by inline attribute editors, drive and card) honour the new permissions. Fixes hcengineering#9079 Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
MichaelUray
force-pushed
the
feat/space-forbid-create-edit
branch
from
October 19, 2026 06:42
c372297 to
6269ddd
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9079
Problem and change
Space type roles could only forbid deleting objects. Add two more space-scoped
forbid permissions, 'Forbid create object' (TxCreateDoc) and 'Forbid edit object'
(TxUpdateDoc, which also covers mixin attribute updates), and offer them in all
space types that already offer 'Forbid delete object'.
They are enforced server-side by SpacePermissionsMiddleware like the existing
forbid permission and apply to all objects inside the space, including
comments and attachments. Two adjustments in the middleware:
itself, so role holders can still manage members, role assignments and
archiving of the space;
now wins instead of depending on the role/permission order.
On the client, canCreateObject and canChangeDoc (used by inline attribute
editors, drive and card) honour the new permissions.
Tests
New unit tests
foundations/server/packages/middleware/src/tests/spacePermissions.test.ts. Checked manually on a self-hosted instance: with a role holding "Forbid create object" and "Forbid edit object", the server rejects creating an issue and editing its title for a member with that role; the space owner can still create/edit and manage members and roles.Notes