Remove all but one hasPermission() method in the PermissionsManager

#739 (cherry picked from commit 65f3347)
This commit is contained in:
Gnat008
2016-06-02 22:35:07 +02:00
committed by ljacqu
parent c3d07cb9a4
commit 73272b5931
7 changed files with 30 additions and 54 deletions
@@ -127,7 +127,7 @@ public class CommandHandler {
private void sendImproperArgumentsMessage(CommandSender sender, FoundCommandResult result) {
CommandDescription command = result.getCommandDescription();
if (!permissionsManager.hasPermission(sender, command)) {
if (!permissionsManager.hasPermission(sender, command.getPermission())) {
sendPermissionDeniedError(sender);
return;
}
@@ -154,7 +154,7 @@ public class CommandMapper {
}
private FoundResultStatus getPermissionAwareStatus(CommandSender sender, CommandDescription command) {
if (sender != null && !permissionsManager.hasPermission(sender, command)) {
if (sender != null && !permissionsManager.hasPermission(sender, command.getPermission())) {
return FoundResultStatus.NO_PERMISSION;
}
return FoundResultStatus.SUCCESS;
@@ -160,7 +160,7 @@ public class HelpProvider implements SettingsDependent {
+ defaultPermission.getTitle() + addendum);
// Evaluate if the sender has permission to the command
if (permissionsManager.hasPermission(sender, command)) {
if (permissionsManager.hasPermission(sender, command.getPermission())) {
lines.add(ChatColor.GOLD + " Result: " + ChatColor.GREEN + ChatColor.ITALIC + "You have permission");
} else {
lines.add(ChatColor.GOLD + " Result: " + ChatColor.DARK_RED + ChatColor.ITALIC + "No permission");