Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Commit

Permalink
[+] grp group add 添加子权限组功能
Browse files Browse the repository at this point in the history
  • Loading branch information
hykilpikonna committed Jul 26, 2018
1 parent ce284f7 commit 11a0644
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,37 @@ else if (args.get(1).equals("remove"))
}
}
}
else if (args.get(0).equals("group"))
{
PermissionGroup newGroup = Main.getDatabase().getGroup(args.get(3));

if (newGroup == null)
{
return "无法编辑, 权限组" + args.get(3) + "不存在";
}

if (args.get(1).equals("add"))
{
if (!group.getContainings().contains(newGroup))
{
group.getContainings().add(newGroup);

Main.getDatabase().setGroup(group);

return "已添加权限组继承: " + newGroup.getGroupName();
}
else
{
return "无法添加继承, 权限组" + newGroup.getGroupName() + "已存在";
}
}
}
}
else
{
return "无法编辑, 权限组" + args.get(2) + "不存在";
}
}

return help(command);
}
Expand Down

0 comments on commit 11a0644

Please sign in to comment.