blob: 03db3502b7e0e5daa4733e6885a8e2d25350baf9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
package com.earth2me.essentials.perm;
import java.util.ArrayList;
import java.util.List;
import net.krinsoft.privileges.Privileges;
import net.krinsoft.privileges.groups.Group;
import net.krinsoft.privileges.groups.GroupManager;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
public class PrivilegesHandler extends SuperpermsHandler
{
private final transient Privileges plugin;
private final GroupManager manager;
public PrivilegesHandler(final Plugin plugin)
{
this.plugin = (Privileges) plugin;
this.manager = this.plugin.getGroupManager();
}
@Override
public String getGroup(final Player base)
{
Group group = manager.getGroup(base);
if (group == null)
{
return null;
}
return group.getName();
}
@Override
public List<String> getGroups(final Player base)
{
Group group = manager.getGroup(base);
if (group == null)
{
return new ArrayList<String>();
}
return group.getGroupTree();
}
@Override
public boolean inGroup(final Player base, final String group)
{
Group pGroup = manager.getGroup(base);
if (pGroup == null)
{
return false;
}
return pGroup.isMemberOf(group);
}
@Override
public boolean canBuild(Player base, String group)
{
return hasPermission(base, "privileges.build");
}
}
|