diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-11-08 18:10:27 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-11-08 18:10:27 +0900 |
| commit | 4624de8087752e580b34c8c33ab5d1bdf20b378a (patch) | |
| tree | 4e5ba1317fed41c648218633869b856cd6687166 | |
| parent | 7a505a9954ff1515058a3d51b7b9f35e81c327fe (diff) | |
modified recordings/recordings-plain.html
| -rw-r--r-- | layouts/recordings/recordings-plain.html | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/layouts/recordings/recordings-plain.html b/layouts/recordings/recordings-plain.html index 006f2d5..ad313b1 100644 --- a/layouts/recordings/recordings-plain.html +++ b/layouts/recordings/recordings-plain.html @@ -171,7 +171,8 @@ {{ $folderGroups := $.Scratch.Get "folderGroups" }} {{ range $folderName, $exists := $folderGroups }} {{ $files := $.Scratch.Get (printf "folder_%s" $folderName) }} - <li class="folder-section"> + {{ $isRestricted := or (eq $folderName "hidden") (eq (lower $folderName) "leak") }} + <li class="folder-section" {{ if $isRestricted }}data-restricted="true"{{ end }}> <details> <summary class="folder-header"> <span class="folder-name" data-encoded="{{ $folderName }}">{{ $folderName }}/</span> @@ -305,6 +306,24 @@ <script> document.addEventListener("DOMContentLoaded", () => { + // 사용자별 제한된 폴더 필터링 (si 사용자만 leak, hidden 볼 수 있음) + // nginx에서 X-Auth-User 헤더로 사용자명 전달 필요 + const checkUserAccess = () => { + // 헤더에서 사용자 정보 읽기 (서버에서 헤더를 meta 태그로 전달하거나 직접 확인) + // 또는 쿠키/로컬스토리지에서 확인 + const restrictedFolders = document.querySelectorAll('li.folder-section[data-restricted="true"]'); + const isSiUser = document.cookie.includes('user=si') || + localStorage.getItem('authUser') === 'si' || + document.querySelector('meta[name="auth-user"]')?.content === 'si'; + + if (!isSiUser) { + restrictedFolders.forEach(folder => { + folder.style.display = 'none'; + }); + } + }; + checkUserAccess(); + // Decode URL-encoded folder names document.querySelectorAll('.folder-name[data-encoded]').forEach(el => { const encoded = el.getAttribute('data-encoded'); |
