feat(role): add 'verwaltung' role with gated access to settings and tools
All checks were successful
Staging Build / build (push) Successful in 3m26s

This commit is contained in:
DanielS
2026-07-03 10:10:57 +02:00
parent ca07dd0079
commit 4f69fd7e44
7 changed files with 129 additions and 41 deletions

View File

@@ -49,7 +49,7 @@ export async function getUsers() {
}));
}
export async function createUser(data: { email: string; role?: 'admin' | 'partner'; email_confirm?: boolean; company_id?: string; first_name?: string; last_name?: string }) {
export async function createUser(data: { email: string; role?: 'admin' | 'partner' | 'verwaltung'; email_confirm?: boolean; company_id?: string; first_name?: string; last_name?: string }) {
const admin = createAdminClient();
const { data: { user }, error } = await admin.auth.admin.createUser({
email: data.email,
@@ -152,7 +152,7 @@ export async function deleteUser(id: string) {
}
}
export async function updateUserRole(id: string, role: 'admin' | 'partner' | 'gesperrt') {
export async function updateUserRole(id: string, role: 'admin' | 'partner' | 'verwaltung' | 'gesperrt') {
const admin = createAdminClient();
const { error } = await admin
.from('users')