Permission System Improvements

This commit is contained in:
Olof Larsson 2016-06-16 19:25:07 +02:00
parent 3b8e54baec
commit 965911d3de
No known key found for this signature in database
GPG Key ID: BBEF14F97DA52474
2 changed files with 4 additions and 5 deletions

View File

@ -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);
}
}

View File

@ -544,8 +544,7 @@ public class MPlayer extends SenderEntity<MPlayer> 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;