mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
Remove unvalidated deposit and null board IDs from source-card scope. Publish deposit content beneath its own reactive visibility-filtered board cursor, applying destination assignment restrictions and reactive card children. Filter status counts by visible assigned scopes. Require destination write access before pointer changes and subtask landing structures, and deny client pointer rename bypasses. Summarize blocked writes in Problems. Positive decisions, scope/dispatcher inventory and existing subtask/status suites pass; browser regression syntax-check passes with live execution pending. Thanks to Wenhao Wu, Southeast University and xet7 !
17 lines
680 B
JavaScript
17 lines
680 B
JavaScript
import Boards from '/models/boards';
|
|
import { allowIsBoardMemberWithWriteAccess } from '/server/lib/utils';
|
|
|
|
export async function canWriteSubtaskDeposit(userId, boardId) {
|
|
if (!userId || typeof boardId !== 'string' || !boardId) return false;
|
|
return allowIsBoardMemberWithWriteAccess(userId, await Boards.findOneAsync(boardId));
|
|
}
|
|
|
|
export function recordSubtaskDepositDenial(source) {
|
|
try {
|
|
require('/server/lib/securityLog').record({
|
|
key: 'authz.subtask-deposit', action: 'blocked', source,
|
|
detail: 'Subtask deposit reference or creation denied because the destination is not writable.',
|
|
});
|
|
} catch (e) { /* logging must never break the guard */ }
|
|
}
|