feat: roles/permissions system and Nostr profile display on admin users
Introduce granular role-based permissions with SuperAdmin env override, admin roles UI, and permission-gated API routes. Fix admin user Nostr metadata by batching relay profile fetches, normalizing npub pubkeys to hex, and adding reusable NostrAvatar/useNostrProfile components. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -80,7 +80,8 @@ export function Navbar() {
|
||||
}
|
||||
|
||||
const displayName = user?.name || user?.displayName || shortenPubkey(user?.pubkey || "");
|
||||
const isStaff = user?.role === "ADMIN" || user?.role === "MODERATOR";
|
||||
const isStaff =
|
||||
!!user?.isSuperAdmin || (user?.permissions?.length ?? 0) > 0;
|
||||
|
||||
function handleLogout() {
|
||||
setDropdownOpen(false);
|
||||
|
||||
Reference in New Issue
Block a user