feat: restrict backup archive download to primary admin and hide admin-hidden projects from other admins

- Add `get_admin_uids()` and `get_primary_admin_uid()` to database.py for resolving the earliest-created admin
- Modify `can_view_project()` in content.py so a project hidden by an admin is invisible to other admins (both web UI and REST API)
- Update `_download_url()` and `_backup_payload()` in admin/backups.py to accept a `can_download` flag, gating the download endpoint with `is_primary_admin()`
- Remove `role` from `_user_facts()` in docs_live.py to avoid leaking admin status in live docs
- Update doc summaries in docs_api.py to reflect the new admin-visibility and backup-download semantics
This commit is contained in:
2026-06-17 14:08:28 +00:00
parent 6b5347103b
commit 0a554ebc32
71 changed files with 1868 additions and 527 deletions
+2 -2
View File
@@ -585,7 +585,7 @@ img {
.topnav-user:hover { background: var(--bg-card); }
.topnav-user-info { display: flex; flex-direction: column; line-height: 1.2; }
.topnav-user-name { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); }
.topnav-user-role { font-size: 0.6875rem; color: var(--text-muted); }
.topnav-user-level { font-size: 0.6875rem; color: var(--text-muted); }
.topnav-user-dropdown { position: relative; }
.topnav-user-dropdown .dropdown-menu {
display: none;
@@ -724,7 +724,7 @@ img {
line-height: 1.2;
}
.topnav-mobile-user-role {
.topnav-mobile-user-level {
font-size: 0.75rem;
color: var(--text-muted);
font-weight: 400;
+1 -1
View File
@@ -96,7 +96,7 @@
color: var(--text-primary);
}
.post-author-role {
.post-author-level {
font-size: 0.6875rem;
color: var(--text-muted);
font-weight: 400;
+1 -1
View File
@@ -25,7 +25,7 @@
font-size: 0.9375rem;
}
.post-detail-role {
.post-detail-level {
font-size: 0.75rem;
color: var(--text-muted);
font-weight: 400;
-7
View File
@@ -36,13 +36,6 @@
word-break: break-word;
}
.profile-role {
font-size: 0.8125rem;
color: var(--text-muted);
font-weight: 500;
margin-bottom: 1rem;
}
.profile-stats {
display: flex;
justify-content: center;