From e14339444cae0b6e2020aecafc9d2f8ed92dda15 Mon Sep 17 00:00:00 2001 From: Driftay Date: Sat, 29 Dec 2018 02:50:44 -0500 Subject: [PATCH] Fixed Disband Exploit --- .../com/massivecraft/factions/cmd/CmdDisband.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdDisband.java b/src/main/java/com/massivecraft/factions/cmd/CmdDisband.java index 446a7e42..a837e1ab 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdDisband.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdDisband.java @@ -30,7 +30,7 @@ public class CmdDisband extends FCommand { this.disableOnLock = true; - senderMustBePlayer = false; + senderMustBePlayer = false; senderMustBeMember = false; senderMustBeModerator = false; senderMustBeColeader = false; @@ -46,6 +46,19 @@ public class CmdDisband extends FCommand { return; } + boolean isMyFaction = fme != null && faction == myFaction; + + if (isMyFaction) { + if (!assertMinRole(Role.LEADER)) { + return; + } + } else { + if (!Permission.DISBAND_ANY.has(sender, true)) { + return; + } + } + + if (!fme.isAdminBypassing()) { Access access = faction.getAccess(fme, PermissableAction.DISBAND); if (fme.getRole() != Role.LEADER && faction.getFPlayerLeader() != fme && access != Access.ALLOW) {