mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
Filter historical rows before search, counts and contributor aggregation using current board visibility and assigned-card scope. Gate all reversal paths with the same scope and current card/linked-card edit permission so revoked access or an old board cannot authorize hidden-card writes. Verified 10 focused Node runner entries and eight Chromium scenarios across History and rule undo/redo, including allowed restores and negative cases. Document detection limits to avoid treating legitimate stale permissions as attributable attacks. Thanks to xet7 !
13 lines
556 B
JavaScript
13 lines
556 B
JavaScript
'use strict';
|
|
|
|
// Current access wins over authorship and over the scope a client selected.
|
|
// Restricted members only receive history belonging to a currently visible
|
|
// card; container snapshots can contain other cards and must not slip through.
|
|
function readableHistoryRow(row, scope) {
|
|
if (!scope || !scope.visible) return false;
|
|
if (!scope.assignedOnly) return true;
|
|
const cardId = row.cardId || (row.entityType === 'card' ? row.entityId : null);
|
|
return Boolean(cardId && scope.cardIds.has(cardId));
|
|
}
|
|
module.exports = { readableHistoryRow };
|