From 0bdcfdb9b8e0fdfe48b58f1d2645325011d668d5 Mon Sep 17 00:00:00 2001 From: usodhi <61431818+usodhi@users.noreply.github.com> Date: Sun, 30 Aug 2020 21:20:24 +0530 Subject: admin alert --- src/client/util/GroupManager.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/client/util/GroupManager.tsx b/src/client/util/GroupManager.tsx index 0765d89e4..cb15b5081 100644 --- a/src/client/util/GroupManager.tsx +++ b/src/client/util/GroupManager.tsx @@ -282,7 +282,11 @@ export class GroupManager extends React.Component<{}> { alert("Please enter a group name"); return; } - if (this.getAllGroups().find(group => group.groupName === this.inputRef.current!.value)) { // why do I need a null check here? + if (this.inputRef.current.value.toLowerCase() === "admin" && this.getGroup("Admin")) { + alert("You cannot override the Admin group"); + return; + } + if (this.getGroup(this.inputRef.current.value)) { alert("Please select a unique group name"); return; } -- cgit v1.2.3-70-g09d2