MCPcopy Create free account
hub / github.com/error311/FileRise / enforceShareFolderRule

Function enforceShareFolderRule

public/js/adminFolderAccess.js:110–124  ·  view source on GitHub ↗
(row)

Source from the content-addressed store, hash-verified

108}
109
110function enforceShareFolderRule(row) {
111 const manage = qs(row, 'input[data-cap="manage"]');
112 const viewAll = qs(row, 'input[data-cap="view"]');
113 const shareFolder = qs(row, 'input[data-cap="shareFolder"]');
114 if (!shareFolder) return;
115 const ok = !!(manage && manage.checked) && !!(viewAll && viewAll.checked);
116 if (!ok) {
117 shareFolder.checked = false;
118 shareFolder.disabled = true;
119 shareFolder.setAttribute('data-disabled-reason', 'Requires Manage + View (all)');
120 } else {
121 shareFolder.disabled = false;
122 shareFolder.removeAttribute('data-disabled-reason');
123 }
124}
125
126function onShareFileToggle(row, checked) {
127 if (!checked) return;

Callers 5

refreshInheritanceFunction · 0.70
setFromViewChangeFunction · 0.70
cascadeManageFunction · 0.70
wireRowFunction · 0.70
renderFolderGrantsUIFunction · 0.70

Calls 1

qsFunction · 0.70

Tested by

no test coverage detected