From 0462026f332de2fd2d2bc442b222b91de5853c1a Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sat, 1 Oct 2011 11:22:19 +0100 Subject: Fixed an issue with superperms where plugins define perms with inheritance after the root perms --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../src/org/anjocaido/groupmanager/Tasks/BukkitPermsUpdateTask.java | 1 + .../org/anjocaido/groupmanager/permissions/BukkitPermissions.java | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'EssentialsGroupManager') diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 4f90b82cd..74752bca8 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -23,4 +23,5 @@ v 1.1: - Fix for GM not checking inheritance for known superperms nodes. - Optimized getAllPlayersPermissions and fixed pushing unknown perms to superperms. v 1.2: - - Changed priority if Registered events to lowest. \ No newline at end of file + - Changed priority of Registered events to lowest. + - Fixed an issue with superperms where plugins define perms with inheritance after the root perms \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/Tasks/BukkitPermsUpdateTask.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/Tasks/BukkitPermsUpdateTask.java index 27951112d..f4b805c35 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/Tasks/BukkitPermsUpdateTask.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/Tasks/BukkitPermsUpdateTask.java @@ -18,6 +18,7 @@ public class BukkitPermsUpdateTask implements Runnable { public void run() { // Signal loaded and update BukkitPermissions. GroupManager.setLoaded(true); + GroupManager.BukkitPermissions.collectPermissions(); GroupManager.BukkitPermissions.updateAllPlayers(); GroupManager.logger.info("Bukkit Permissions Updated!"); diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java index 20f6331bc..b4035a1f5 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java @@ -93,7 +93,7 @@ public class BukkitPermissions { manager.registerEvent(Event.Type.PLUGIN_DISABLE, serverListener, Event.Priority.Normal, plugin); } - private void collectPermissions() { + public void collectPermissions() { registeredPermissions.clear(); for (Plugin bukkitPlugin : Bukkit.getServer().getPluginManager().getPlugins()) { for(Permission permission : bukkitPlugin.getDescription().getPermissions()) @@ -134,8 +134,8 @@ public class BukkitPermissions { Boolean value; for (Permission permission : registeredPermissions) { value = worldData.getPermissionsHandler().checkUserPermission(user, permission.getName()); - - attachment.setPermission(permission, value); + if (value == true) + attachment.setPermission(permission, value); } // Add any missing permissions for this player (non bukkit plugins) -- cgit v1.2.3