mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 11:15:21 +01:00
Straighten out GroupManager offline permissions
This commit is contained in:
parent
f0f881d126
commit
1793d910d4
@ -748,12 +748,12 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
permissions = PEXPermissions.create(getServer(), "dynmap");
|
||||
if (permissions == null)
|
||||
permissions = bPermPermissions.create(getServer(), "dynmap", perdefs);
|
||||
if (permissions == null)
|
||||
permissions = GroupManagerPermissions.create(getServer(), "dynmap");
|
||||
if (permissions == null)
|
||||
permissions = PermBukkitPermissions.create(getServer(), "dynmap", perdefs);
|
||||
if (permissions == null)
|
||||
permissions = NijikokunPermissions.create(getServer(), "dynmap");
|
||||
if (permissions == null)
|
||||
permissions = GroupManagerPermissions.create(getServer(), "dynmap");
|
||||
if (permissions == null)
|
||||
permissions = BukkitPermissions.create("dynmap", perdefs);
|
||||
if (permissions == null)
|
||||
|
@ -37,13 +37,14 @@ public class GroupManagerPermissions implements PermissionProvider {
|
||||
@Override
|
||||
public boolean has(CommandSender sender, String permission) {
|
||||
Player player = sender instanceof Player ? (Player) sender : null;
|
||||
return (player != null) ? wh.getWorldPermissions(player).has(player, name + "." + permission) : true;
|
||||
boolean rslt = (player != null) ? gm.getWorldsHolder().getDefaultWorld().getPermissionsHandler().permission(player, name + "." + permission) : true;
|
||||
return rslt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> hasOfflinePermissions(String player, Set<String> perms) {
|
||||
HashSet<String> hasperms = new HashSet<String>();
|
||||
AnjoPermissionsHandler apm = wh.getWorldPermissionsByPlayerName(player);
|
||||
AnjoPermissionsHandler apm = gm.getWorldsHolder().getDefaultWorld().getPermissionsHandler();
|
||||
if (apm != null) {
|
||||
for (String pp : perms) {
|
||||
if (apm.permission(player, name + "." + pp)) {
|
||||
@ -55,10 +56,11 @@ public class GroupManagerPermissions implements PermissionProvider {
|
||||
}
|
||||
@Override
|
||||
public boolean hasOfflinePermission(String player, String perm) {
|
||||
AnjoPermissionsHandler apm = wh.getWorldPermissionsByPlayerName(player);
|
||||
AnjoPermissionsHandler apm = gm.getWorldsHolder().getDefaultWorld().getPermissionsHandler();
|
||||
boolean rslt = false;
|
||||
if(apm != null) {
|
||||
return apm.permission(player, name + "." + perm);
|
||||
rslt = apm.permission(player, name + "." + perm);
|
||||
}
|
||||
return false;
|
||||
return rslt;
|
||||
}
|
||||
}
|
||||
|
@ -24,8 +24,9 @@ public class PEXPermissions implements PermissionProvider {
|
||||
server.getPluginManager().enablePlugin(permissionsPlugin);
|
||||
if(permissionsPlugin.isEnabled() == false)
|
||||
return null;
|
||||
if(PermissionsEx.isAvailable() == false)
|
||||
return null;
|
||||
//Broken in new dev builds, apparently
|
||||
//if(PermissionsEx.isAvailable() == false)
|
||||
// return null;
|
||||
Log.info("Using PermissionsEx " + permissionsPlugin.getDescription().getVersion() + " for access control");
|
||||
return new PEXPermissions(name);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user