Allow admins create other admins

This commit is contained in:
Tiago Ribeiro
2024-09-08 19:27:12 +01:00
parent a5b3a7e94d
commit 31a01a3157

View File

@@ -53,7 +53,7 @@ const USER_TYPE_PERMISSIONS: {
}, },
admin: { admin: {
perm: "createCodeAdmin", perm: "createCodeAdmin",
list: ["student", "teacher", "agent", "corporate", "admin", "mastercorporate"], list: ["student", "teacher", "agent", "corporate", "mastercorporate"],
}, },
developer: { developer: {
perm: undefined, perm: undefined,
@@ -161,7 +161,7 @@ export default function BatchCreateUser({user, users, permissions, onFinish}: Pr
setIsLoading(true); setIsLoading(true);
try { try {
await axios.post("/api/batch_users", { users: newUsers.map(user => ({...user, type, expiryDate})) }); await axios.post("/api/batch_users", {users: newUsers.map((user) => ({...user, type, expiryDate}))});
toast.success(`Successfully added ${newUsers.length} user(s)!`); toast.success(`Successfully added ${newUsers.length} user(s)!`);
onFinish(); onFinish();
} catch { } catch {