summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-04-16 07:01:18 +0000
committersnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-04-16 07:01:18 +0000
commitc5474e4cb6cd62b021db4e68a16924269ddcc58e (patch)
tree26e6ce101e1f2ab4c0938b54cca28bd5e7d6f4a1
parent24b0034c517de783276247e6ceace05138373b03 (diff)
downloadEssentials-c5474e4cb6cd62b021db4e68a16924269ddcc58e.tar
Essentials-c5474e4cb6cd62b021db4e68a16924269ddcc58e.tar.gz
Essentials-c5474e4cb6cd62b021db4e68a16924269ddcc58e.tar.lz
Essentials-c5474e4cb6cd62b021db4e68a16924269ddcc58e.tar.xz
Essentials-c5474e4cb6cd62b021db4e68a16924269ddcc58e.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.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/PlayerExtension.java12
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()
{