From 497a08940ee20cbd8ed8478530c9d030bc96e81e Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sat, 24 Sep 2011 15:26:55 +0100 Subject: manulistp now accepts an additional + to list ALL Superperms effective permissions (/manulistp +). manucheckp also outputs superperms results. --- .../permissions/BukkitPermissions.java | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions') diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java index cf3edafc0..afb65b26c 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java @@ -43,6 +43,7 @@ import org.bukkit.event.server.PluginEnableEvent; import org.bukkit.event.server.ServerListener; import org.bukkit.permissions.Permission; import org.bukkit.permissions.PermissionAttachment; +import org.bukkit.permissions.PermissionAttachmentInfo; //import org.bukkit.permissions.PermissionAttachmentInfo; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginManager; @@ -106,7 +107,7 @@ public class BukkitPermissions { } public void updatePermissions(Player player, String world) { - if (player == null || !this.plugin.isEnabled()) { + if (player == null || !GroupManager.isLoaded) { return; } @@ -172,6 +173,27 @@ public class BukkitPermissions { } */ } + + public List listPerms(Player player) { + List perms = new ArrayList(); + + /* + // All permissions registered with Bukkit for this player + PermissionAttachment attachment = this.attachments.get(player); + + // List perms for this player + perms.add("Attachment Permissions:"); + for(Map.Entry entry : attachment.getPermissions().entrySet()){ + perms.add(" " + entry.getKey() + " = " + entry.getValue()); + } + */ + + perms.add("Effective Permissions:"); + for(PermissionAttachmentInfo info : player.getEffectivePermissions()){ + perms.add(" " + info.getPermission() + " = " + info.getValue()); + } + return perms; + } public void updateAllPlayers() { for (Player player : Bukkit.getServer().getOnlinePlayers()) { -- cgit v1.2.3