feat: add team_lead role to user management and update related functionalities

This commit is contained in:
2025-11-14 08:08:01 +01:00
parent eec0c0a281
commit 23b3c0e9e8
8 changed files with 123 additions and 5 deletions

View File

@@ -53,7 +53,7 @@ export function getAllUsers() {
// Update user role
export function updateUserRole(userId, role) {
const validRoles = ['admin', 'project_manager', 'user', 'read_only']
const validRoles = ['admin', 'team_lead', 'project_manager', 'user', 'read_only']
if (!validRoles.includes(role)) {
throw new Error("Invalid role")
}
@@ -159,7 +159,7 @@ export async function updateUser(userId, updates) {
}
if (updates.role !== undefined) {
const validRoles = ['admin', 'project_manager', 'user', 'read_only'];
const validRoles = ['admin', 'team_lead', 'project_manager', 'user', 'read_only'];
if (!validRoles.includes(updates.role)) {
throw new Error("Invalid role");
}