blob: 66aba8f9c25c8cb06a8c88bfff35c795ef670c2a (
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
|
package com.earth2me.essentials.permissions;
import com.earth2me.essentials.utils.Util;
import com.earth2me.essentials.api.IPermission;
import com.earth2me.essentials.api.server.CommandSender;
import com.earth2me.essentials.api.server.Permission;
public abstract class AbstractSuperpermsPermission implements IPermission
{
protected Permission bukkitPerm;
@Override
public Permission getPermission()
{
if (bukkitPerm != null)
{
return bukkitPerm;
}
else
{
return Permission.create(getPermissionName(), getPermissionDefault());
}
}
/**
* PermissionDefault is OP, if the method is not overwritten.
* @return
*/
@Override
public Permission.Default getPermissionDefault()
{
return Permission.Default.OP;
}
@Override
public boolean isAuthorized(final CommandSender sender)
{
return sender.hasPermission(getPermission());
}
}
|