summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2012-03-03 13:00:17 +0000
committerElgarL <ElgarL@palmergames.com>2012-03-03 13:00:17 +0000
commitd2d8d191dad6af966ee1bda365d72098a52b587b (patch)
tree9f4b58e2e3218a98622604bef7d445b3ed0bd553 /EssentialsGroupManager/src
parenta8da3eebd72eaf74303502a251a2daa8a371de92 (diff)
downloadEssentials-d2d8d191dad6af966ee1bda365d72098a52b587b.tar
Essentials-d2d8d191dad6af966ee1bda365d72098a52b587b.tar.gz
Essentials-d2d8d191dad6af966ee1bda365d72098a52b587b.tar.lz
Essentials-d2d8d191dad6af966ee1bda365d72098a52b587b.tar.xz
Essentials-d2d8d191dad6af966ee1bda365d72098a52b587b.zip
Minor optimization when checking bukkit permissions.
Diffstat (limited to 'EssentialsGroupManager/src')
-rw-r--r--EssentialsGroupManager/src/Changelog.txt3
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java8
2 files changed, 5 insertions, 6 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt
index 9d7187690..9ea8082c0 100644
--- a/EssentialsGroupManager/src/Changelog.txt
+++ b/EssentialsGroupManager/src/Changelog.txt
@@ -146,4 +146,5 @@ v 1.9:
- Removed BukkitPermsOverride as this is now the default with bukkit handling child nodes.
- Prevent adding inheritances and info nodes to globalgroups. These are permissions collections, not player groups.
- Prevent promoting players to, and demoting to GlobalGroups.
- - Make 'manload' reload the config correctly. \ No newline at end of file
+ - Make 'manload' reload the config correctly.
+ - Minor optimization when checking bukkit permissions. \ No newline at end of file
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java
index bd2829f38..b9315e849 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java
@@ -17,9 +17,7 @@ import org.anjocaido.groupmanager.dataholder.WorldDataHolder;
import org.anjocaido.groupmanager.data.User;
import org.anjocaido.groupmanager.utils.PermissionCheckResult;
import org.anjocaido.groupmanager.utils.PermissionCheckResult.Type;
-import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
-import org.bukkit.permissions.Permission;
/**
* Everything here maintains the model created by Nijikokun
@@ -767,9 +765,9 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
// Check Bukkit perms to support plugins which add perms via code
// (Heroes).
final Player player = user.getBukkitPlayer();
- final Permission bukkitPerm = Bukkit.getPluginManager().getPermission(targetPermission);
- if (player != null && bukkitPerm != null) {
- result.resultType = player.hasPermission(bukkitPerm) ? PermissionCheckResult.Type.FOUND : PermissionCheckResult.Type.NEGATION;
+ //final Permission bukkitPerm = Bukkit.getPluginManager().getPermission(targetPermission);
+ if (player != null && player.hasPermission(targetPermission)) {
+ result.resultType = PermissionCheckResult.Type.FOUND;
result.owner = user;
return result;
}