From ad10222c2defed75de23eae252897899229bcdfe Mon Sep 17 00:00:00 2001 From: Trent Hensler Date: Sat, 3 Feb 2018 13:01:25 -0800 Subject: [PATCH] Withdraw f perm --- .../java/com/massivecraft/factions/cmd/CmdKick.java | 2 +- .../massivecraft/factions/cmd/CmdMoneyWithdraw.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdKick.java b/src/main/java/com/massivecraft/factions/cmd/CmdKick.java index aae12d09..6f242bcc 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdKick.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdKick.java @@ -68,7 +68,7 @@ public class CmdKick extends FCommand { // players with admin-level "disband" permission can bypass these requirements if (!Permission.KICK_ANY.has(sender)) { - Access access = myFaction.getAccess(fme, PermissableAction.INVITE); + Access access = myFaction.getAccess(fme, PermissableAction.KICK); if (access == Access.DENY || (access == Access.UNDEFINED && !assertMinRole(Role.MODERATOR))) { fme.msg(TL.GENERIC_NOPERMISSION, "kick"); return; diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdMoneyWithdraw.java b/src/main/java/com/massivecraft/factions/cmd/CmdMoneyWithdraw.java index 92042b39..63e5cdb8 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdMoneyWithdraw.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdMoneyWithdraw.java @@ -5,6 +5,9 @@ import com.massivecraft.factions.P; import com.massivecraft.factions.iface.EconomyParticipator; import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.struct.Permission; +import com.massivecraft.factions.struct.Role; +import com.massivecraft.factions.zcore.fperms.Access; +import com.massivecraft.factions.zcore.fperms.PermissableAction; import com.massivecraft.factions.zcore.util.TL; import org.bukkit.ChatColor; @@ -33,6 +36,13 @@ public class CmdMoneyWithdraw extends FCommand { if (faction == null) { return; } + + Access access = myFaction.getAccess(fme, PermissableAction.WITHDRAW); + if (access == Access.DENY) { + fme.msg(TL.GENERIC_NOPERMISSION, "withdraw"); + return; + } + boolean success = Econ.transferMoney(fme, faction, fme, amount); if (success && Conf.logMoneyTransactions) {