feat: allow read-only users to assign labels to cards (#590)#7940
Open
guangningsun wants to merge 1 commit into
Open
feat: allow read-only users to assign labels to cards (#590)#7940guangningsun wants to merge 1 commit into
guangningsun wants to merge 1 commit into
Conversation
Lower the permission check in assignLabel() from PERMISSION_EDIT to PERMISSION_READ, allowing users with read-only access to add labels to cards. This is useful when a board owner wants to share cards with external contributors who should be able to self-assign labels but not modify card content. RemoveLabel() still requires PERMISSION_EDIT to prevent read-only users from removing labels. Fixes nextcloud#590
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.
Summary
Fixes #590 — Allow users with read-only board access to assign labels to cards.
Problem
Users with only
PERMISSION_READon a board could not assign labels to cards, even though the board owner intended them to self-manage card labels. TheassignLabel()method requiredPERMISSION_EDIT, which is too restrictive for collaborative workflows.Solution
Lower the permission check in
CardService::assignLabel()fromPERMISSION_EDITtoPERMISSION_READ:removeLabel()still requiresPERMISSION_EDIT, so read-only users can add labels but cannot remove them.Additional Changes
testAssignLabelWithReadPermission— READ-permission user CAN add labelstestAssignLabelWithoutReadPermission— no-permission user CANNOT add labelstestRemoveLabelRequiresEditPermission— EDIT-permission user CAN remove labelstestRemoveLabelWithoutEditPermission— no-permission user CANNOT remove labelsBC Note
This is a backwards-compatible bug fix. Read-only users who previously could not add labels now can, but they still cannot remove labels or modify card content.
Closes #590