Package org.anjocaido.groupmanager.permissions

Examples of org.anjocaido.groupmanager.permissions.AnjoPermissionsHandler


        setPlayerValue(worldName, playerName, node, value);
    }

    @Override
    public String getGroupInfoString(String worldName, String groupName, String node, String defaultValue) {
        AnjoPermissionsHandler handler;
        if (worldName == null) {
            handler = groupManager.getWorldsHolder().getDefaultWorld().getPermissionsHandler();
        } else {
            handler = groupManager.getWorldsHolder().getWorldPermissions(worldName);
        }
        if (handler == null) {
            return defaultValue;
        }
        String val = handler.getGroupPermissionString(groupName, node);
        return val != null ? val : defaultValue;
    }
View Full Code Here


        setGroupValue(worldName, groupName, node, value);
    }

    @Override
    public String getPlayerPrefix(String worldName, String playerName) {
        AnjoPermissionsHandler handler;
        if (worldName == null) {
            handler = groupManager.getWorldsHolder().getWorldPermissionsByPlayerName(playerName);
        } else {
            handler = groupManager.getWorldsHolder().getWorldPermissions(worldName);
        }
        if (handler == null) {
            return "";
        }
        return handler.getUserPrefix(playerName);
    }
View Full Code Here

        return handler.getUserPrefix(playerName);
    }

    @Override
    public String getPlayerSuffix(String worldName, String playerName) {
        AnjoPermissionsHandler handler;
        if (worldName == null) {
            handler = groupManager.getWorldsHolder().getWorldPermissionsByPlayerName(playerName);
        } else {
            handler = groupManager.getWorldsHolder().getWorldPermissions(worldName);
        }
        if (handler == null) {
            return "";
        }
        return handler.getUserSuffix(playerName);
    }
View Full Code Here

        setGroupInfoString(worldName, group, "suffix", suffix);
    }

    @Override
    public String getPrimaryGroup(String worldName, String playerName) {
        AnjoPermissionsHandler handler;
        if (worldName == null) {
            handler = groupManager.getWorldsHolder().getWorldPermissionsByPlayerName(playerName);
        } else {
            handler = groupManager.getWorldsHolder().getWorldPermissions(worldName);
        }
        return handler.getGroup(playerName);
    }
View Full Code Here

        return groupManager != null && groupManager.isEnabled();
    }

    @Override
    public boolean playerHas(String worldName, String playerName, String permission) {
        AnjoPermissionsHandler handler;
        if (worldName == null) {
            handler = groupManager.getWorldsHolder().getWorldPermissionsByPlayerName(playerName);
        }
        else {
            handler = groupManager.getWorldsHolder().getWorldPermissions(worldName);
        }
        if (handler == null) {
            return false;
        }
        return handler.permission(playerName, permission);
    }
View Full Code Here

        return true;
    }

    @Override
    public boolean playerInGroup(String worldName, String playerName, String groupName) {
        AnjoPermissionsHandler handler;
        if (worldName == null) {
            handler = groupManager.getWorldsHolder().getWorldPermissionsByPlayerName(playerName);
        } else {
            handler = groupManager.getWorldsHolder().getWorldPermissions(worldName);
        }
        if (handler == null) {
            return false;
        }
        return handler.inGroup(playerName, groupName);
    }
View Full Code Here

        return success;
    }

    @Override
    public String[] getPlayerGroups(String worldName, String playerName) {
        AnjoPermissionsHandler handler;
        if (worldName == null) {
            handler = groupManager.getWorldsHolder().getWorldPermissionsByPlayerName(playerName);
        } else {
            handler = groupManager.getWorldsHolder().getWorldPermissions(worldName);
        }
        if (handler == null) {
            return null;
        }
        return handler.getGroups(playerName);
    }
View Full Code Here

        return handler.getGroups(playerName);
    }

    @Override
    public String getPrimaryGroup(String worldName, String playerName) {
        AnjoPermissionsHandler handler;
        if (worldName == null) {
            handler = groupManager.getWorldsHolder().getWorldPermissionsByPlayerName(playerName);
        } else {
            handler = groupManager.getWorldsHolder().getWorldPermissions(worldName);
        }
        if (handler == null) {
            return null;
        }
        return handler.getGroup(playerName);
    }
View Full Code Here

    }
   
    @Override
    public Set<String> hasOfflinePermissions(String player, Set<String> perms) {
        HashSet<String> hasperms = new HashSet<String>();
        AnjoPermissionsHandler apm = gm.getWorldsHolder().getDefaultWorld().getPermissionsHandler();
        if (apm != null) {
            for (String pp : perms) {
                if (apm.permission(player, name + "." + pp)) {
                    hasperms.add(pp);
                }
            }
        }
        return hasperms;
View Full Code Here

        }
        return hasperms;
    }
    @Override
    public boolean hasOfflinePermission(String player, String perm) {
        AnjoPermissionsHandler apm = gm.getWorldsHolder().getDefaultWorld().getPermissionsHandler();
        boolean rslt = false;
        if(apm != null) {
            rslt = apm.permission(player, name + "." + perm);
        }
        return rslt;
    }
View Full Code Here

TOP

Related Classes of org.anjocaido.groupmanager.permissions.AnjoPermissionsHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.