Skip to content

Commit 7842ef1

Browse files
authored
Admin must not see subfolders of personal folders (#516)
Fixes #514
1 parent 84c27f3 commit 7842ef1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

model/folder.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ export async function userTree (user) {
351351

352352
// Each child is also added to read-permitted folders for caching
353353
for (const el of achildren) {
354-
// Only 'admin' user can see all personal folders
355-
if (el.personal === true && el.user !== user && user !== '0') {
354+
// Admin can see all personal folders, but only at the first level
355+
if (el.personal && !(user === Const.PW_USER_ADMINID && el.parent === Const.PW_FOLDER_PERSONALROOTID)) {
356356
continue
357357
}
358358

0 commit comments

Comments
 (0)