Skip to content

Commit 477756e

Browse files
committedApr 24, 2025
fix: Fixed card subscription for non-editor
1 parent 2323f79 commit 477756e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎server/api/controllers/cards/update.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,12 @@ module.exports = {
123123
throw Errors.CARD_NOT_FOUND; // Forbidden
124124
}
125125

126-
if (boardMembership.role !== BoardMembership.Roles.EDITOR) {
127-
throw Errors.NOT_ENOUGH_RIGHTS;
126+
const isEditor = boardMembership.role === BoardMembership.Roles.EDITOR;
127+
if (!isEditor) {
128+
const allowedOnlyIsSubscribed = Object.keys(inputs).every((key) => ['id', 'isSubscribed'].includes(key));
129+
if (!allowedOnlyIsSubscribed) {
130+
throw Errors.NOT_ENOUGH_RIGHTS;
131+
}
128132
}
129133

130134
let nextBoard;

0 commit comments

Comments
 (0)