From 965911d3dea2cbfca8e6d3c3f38b4c0bd67b8384 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Thu, 16 Jun 2016 19:25:07 +0200 Subject: [PATCH] Permission System Improvements --- src/com/massivecraft/factions/Perm.java | 6 +++--- src/com/massivecraft/factions/entity/MPlayer.java | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/com/massivecraft/factions/Perm.java b/src/com/massivecraft/factions/Perm.java index 45c8795a..19583f83 100644 --- a/src/com/massivecraft/factions/Perm.java +++ b/src/com/massivecraft/factions/Perm.java @@ -110,14 +110,14 @@ public enum Perm implements Identified // HAS // -------------------------------------------- // - public boolean has(Permissible permissible, boolean informSenderIfNot) + public boolean has(Permissible permissible, boolean verboose) { - return PermissionUtil.hasPermission(permissible, this.id, informSenderIfNot); + return PermissionUtil.hasPermission(permissible, this, verboose); } public boolean has(Permissible permissible) { - return has(permissible, false); + return PermissionUtil.hasPermission(permissible, this); } } diff --git a/src/com/massivecraft/factions/entity/MPlayer.java b/src/com/massivecraft/factions/entity/MPlayer.java index 12b2c315..a12ffa0d 100644 --- a/src/com/massivecraft/factions/entity/MPlayer.java +++ b/src/com/massivecraft/factions/entity/MPlayer.java @@ -544,8 +544,7 @@ public class MPlayer extends SenderEntity implements EconomyParticipato if (this.overriding == null) return false; if (this.overriding == false) return false; - // Deactivate admin mode if we don't have permissions for it. - if (this.getSender() != null && ! Perm.OVERRIDE.has(this.getSender(), false)) + if (!this.hasPermission(Perm.OVERRIDE, true)) { this.setOverriding(false); return false;