summaryrefslogtreecommitdiffstats
path: root/Essentials/src/com/earth2me/essentials/perm/ConfigPermissionsHandler.java
blob: f51ce45188a8ce2dadeaf6f4e36f89d02fe765b7 (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
package com.earth2me.essentials.perm;

import com.earth2me.essentials.IEssentials;
import java.util.List;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;


public class ConfigPermissionsHandler extends SuperpermsHandler
{
	private final transient IEssentials ess;

	public ConfigPermissionsHandler(final Plugin ess)
	{
		this.ess = (IEssentials)ess;
	}

	@Override
	public boolean canBuild(final Player base, final String group)
	{
		return true;
	}

	@Override
	public boolean hasPermission(final Player base, final String node)
	{
		final String[] cmds = node.split("\\.", 2);
		return ess.getSettings().isPlayerCommand(cmds[cmds.length - 1]) || super.hasPermission(base, node);
	}

}