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 | 1661eddc0208db7e990ad07118970fae649ec937 (patch) | |
tree | de0c837c7c9b48ca0a805ebfdbbe66da7c63287e /EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions | |
parent | 15be319d3ec0a07b760c6f20ca8d5973d4af0cc2 (diff) | |
download | Essentials-1661eddc0208db7e990ad07118970fae649ec937.tar Essentials-1661eddc0208db7e990ad07118970fae649ec937.tar.gz Essentials-1661eddc0208db7e990ad07118970fae649ec937.tar.lz Essentials-1661eddc0208db7e990ad07118970fae649ec937.tar.xz Essentials-1661eddc0208db7e990ad07118970fae649ec937.zip |
Make gm API lookup respect offlineperms toggle properly.
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions')
-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; } |