From 11a0644b8ed4524c46b48fe672901b6cdc1db936 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Thu, 26 Jul 2018 20:51:21 +0800 Subject: [PATCH] =?UTF-8?q?[+]=20grp=20group=20add=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=AD=90=E6=9D=83=E9=99=90=E7=BB=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../permissions/commands/CommandGroups.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/main/java/cc/moecraft/icq/plugins/permissions/commands/CommandGroups.java b/src/main/java/cc/moecraft/icq/plugins/permissions/commands/CommandGroups.java index 5a2ad0a..a0a7b00 100644 --- a/src/main/java/cc/moecraft/icq/plugins/permissions/commands/CommandGroups.java +++ b/src/main/java/cc/moecraft/icq/plugins/permissions/commands/CommandGroups.java @@ -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); }