Enhance dashboard guild access with owner bypass functionality

- Introduced `resolveDashboardGuild` to handle guild resolution for both managed and owner-panel bypass scenarios.
- Updated `GuildLayout` and `WelcomePage` components to utilize the new guild resolution logic, improving access handling.
- Enhanced `DashboardShell` to display an informational banner for users accessing guilds via the owner-panel bypass.
- Added localization support for owner bypass messages in English and German.
- Updated authentication logic to allow owner-panel users to access guilds without Discord Manage Guild permission.
This commit is contained in:
smueller
2026-07-24 11:59:16 +02:00
parent e45642b6f9
commit 20593b7173
10 changed files with 133 additions and 22 deletions

View File

@@ -31,6 +31,14 @@ export async function isOwnerUser(userId: string): Promise<boolean> {
return (await resolveOwnerRole(userId)) !== null;
}
/**
* Owner-panel team members (any role) may open every guild where the bot is
* installed — for support without needing Manage Guild on Discord.
*/
export async function hasOwnerGuildBypass(userId: string): Promise<boolean> {
return (await resolveOwnerRole(userId)) !== null;
}
export async function requireOwner(minimum: OwnerRole = 'VIEWER'): Promise<OwnerSession> {
const session = await requireAuth();
const role = await resolveOwnerRole(session.user.id);