1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-02-24 08:22:56 +01:00

[trunk] Groups for Protection signs.

Group inheritance.

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1213 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
snowleo 2011-04-16 07:01:18 +00:00
parent 24b0034c51
commit c5474e4cb6
2 changed files with 13 additions and 1 deletions

View File

@ -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())) {

View File

@ -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()
{