Withdraw f perm

This commit is contained in:
Trent Hensler 2018-02-03 13:01:25 -08:00
parent 925014bd60
commit ad10222c2d
2 changed files with 11 additions and 1 deletions

View File

@ -68,7 +68,7 @@ public class CmdKick extends FCommand {
// players with admin-level "disband" permission can bypass these requirements // players with admin-level "disband" permission can bypass these requirements
if (!Permission.KICK_ANY.has(sender)) { 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))) { if (access == Access.DENY || (access == Access.UNDEFINED && !assertMinRole(Role.MODERATOR))) {
fme.msg(TL.GENERIC_NOPERMISSION, "kick"); fme.msg(TL.GENERIC_NOPERMISSION, "kick");
return; return;

View File

@ -5,6 +5,9 @@ import com.massivecraft.factions.P;
import com.massivecraft.factions.iface.EconomyParticipator; import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission; 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 com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -33,6 +36,13 @@ public class CmdMoneyWithdraw extends FCommand {
if (faction == null) { if (faction == null) {
return; 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); boolean success = Econ.transferMoney(fme, faction, fme, amount);
if (success && Conf.logMoneyTransactions) { if (success && Conf.logMoneyTransactions) {