diff options
author | KHobbits <rob@khobbits.co.uk> | 2013-02-01 00:01:57 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-02-01 00:01:57 +0000 |
commit | 27697c7b0ca96245a29b439e7539f0ff81a6805d (patch) | |
tree | 1c38e8cd02c96bb156beabbf54c7121fcfa073bc /EssentialsGroupManager/src/org | |
parent | 94769334d637aa033f8d1873c4755dfa4c104444 (diff) | |
download | Essentials-27697c7b0ca96245a29b439e7539f0ff81a6805d.tar Essentials-27697c7b0ca96245a29b439e7539f0ff81a6805d.tar.gz Essentials-27697c7b0ca96245a29b439e7539f0ff81a6805d.tar.lz Essentials-27697c7b0ca96245a29b439e7539f0ff81a6805d.tar.xz Essentials-27697c7b0ca96245a29b439e7539f0ff81a6805d.zip |
Make gm API lookup respect offlineperms toggle properly.
Diffstat (limited to 'EssentialsGroupManager/src/org')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java index a221c56a2..f303aea35 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java @@ -789,9 +789,9 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { * We are in offline mode * and the player has the 'groupmanager.noofflineperms' permission. */ - if (user == null || targetPermission == null || targetPermission.isEmpty() || - (!Bukkit.getServer().getOnlineMode() - && (checkPermission(user, "groupmanager.noofflineperms", true).resultType == PermissionCheckResult.Type.FOUND))) { + if (user == null || targetPermission == null || targetPermission.isEmpty() + || (!Bukkit.getServer().getOnlineMode() + && (checkPermission(user, "groupmanager.noofflineperms", false).resultType == PermissionCheckResult.Type.FOUND))) { PermissionCheckResult result = new PermissionCheckResult(); result.accessLevel = targetPermission; @@ -1037,6 +1037,15 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { userAccessLevelOffset = 1; result = PermissionCheckResult.Type.NEGATION; } + + if (fullPermissionName.equals(userAccessLevel)) { + return result; + } + + if ("groupmanager.noofflineperms".equals(fullPermissionName)) { + result = PermissionCheckResult.Type.NOTFOUND; + } + if ("*".regionMatches(0, userAccessLevel, userAccessLevelOffset, userAccessLevelLength - userAccessLevelOffset)) { return result; } |