diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-04-16 07:01:18 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-04-16 07:01:18 +0000 |
commit | 0b95a2f41720ac60f7ff9d01d4255030316bcc0e (patch) | |
tree | 821e41d7696b34f38df6e9aec5d1a889f664c45b | |
parent | 09ab9815857f0d695fdaa9d257673b2fc3d733eb (diff) | |
download | Essentials-0b95a2f41720ac60f7ff9d01d4255030316bcc0e.tar Essentials-0b95a2f41720ac60f7ff9d01d4255030316bcc0e.tar.gz Essentials-0b95a2f41720ac60f7ff9d01d4255030316bcc0e.tar.lz Essentials-0b95a2f41720ac60f7ff9d01d4255030316bcc0e.tar.xz Essentials-0b95a2f41720ac60f7ff9d01d4255030316bcc0e.zip |
[trunk] Groups for Protection signs.
Group inheritance.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1213 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r-- | Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java | 2 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/PlayerExtension.java | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java index f75d57ab6..8cfd6b9c4 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java @@ -242,7 +242,7 @@ public class EssentialsBlockListener extends BlockListener String line = sign.getLine(i); if (line.startsWith("(") && line.endsWith(")")) { line = line.substring(1, line.length() - 2); - if (user.getGroup().equalsIgnoreCase(line)) { + if (user.inGroup(line)) { return ALLOWED; } } else if (line.equalsIgnoreCase(user.getName())) { diff --git a/Essentials/src/com/earth2me/essentials/PlayerExtension.java b/Essentials/src/com/earth2me/essentials/PlayerExtension.java index 5b7c8bd63..9955a3156 100644 --- a/Essentials/src/com/earth2me/essentials/PlayerExtension.java +++ b/Essentials/src/com/earth2me/essentials/PlayerExtension.java @@ -118,6 +118,18 @@ public class PlayerExtension extends PlayerWrapper return "default"; } } + + public boolean inGroup(String group) + { + try + { + return com.nijikokun.bukkit.Permissions.Permissions.Security.inGroup(getWorld().getName(), getName(), group); + } + catch (Throwable ex) + { + return false; + } + } public boolean canBuild() { |