Package net.milkbowl.vault.permission

Examples of net.milkbowl.vault.permission.Permission


    public List<String> getGroupPermsForWorld(String groupName, String world) {
        if (!(permissionsAvailable())) {
            return new ArrayList<String>(0);
        }
        ServicesManager sm = Bukkit.getServicesManager();
        Permission p = sm.getRegistration(Permission.class).getProvider();
        List<String> result = new ArrayList<String>();
        for (org.bukkit.permissions.Permission perm : Bukkit.getPluginManager().getPermissions()) {
            String permName = perm.getName();
            if (p.groupHas(world, groupName, permName)) {
                result.add(permName);
            }
        }
        return result;
    }
View Full Code Here


    public List<String> getUserPerms(String userName) {
        if (!(permissionsAvailable())) {
            return new ArrayList<String>(0);
        }
        ServicesManager sm = Bukkit.getServicesManager();
        Permission p = sm.getRegistration(Permission.class).getProvider();
        List<String> result = new ArrayList<String>();
        Player ply = Bukkit.getPlayer(userName);
        if (ply == null) {
            return result;
        }
        for (org.bukkit.permissions.Permission perm : Bukkit.getPluginManager().getPermissions()) {
            String permName = perm.getName();
            if (p.has(ply, permName)) {
                result.add(permName);
            }
        }
        return result;
    }
View Full Code Here

    public List<String> getUsersWithPermission(String permission) {
        if (!(permissionsAvailable())) {
            return new ArrayList<String>(0);
        }
        ServicesManager sm = Bukkit.getServicesManager();
        Permission p = sm.getRegistration(Permission.class).getProvider();
        List<String> result = new ArrayList<String>();
        for (Player player : Bukkit.getOnlinePlayers()) {
            if (p.has(player, permission)) {
                result.add(player.getName());
            }
        }
        return result;
    }
View Full Code Here

    public boolean userHasPermission(String userName, String permission, String world) {
        if (!(permissionsAvailable())) {
            return false;
        }
        ServicesManager sm = Bukkit.getServicesManager();
        Permission p = sm.getRegistration(Permission.class).getProvider();
        return p.has(world, userName, permission);
    }
View Full Code Here

    public List<String> getWorldsUserHasPermission(String userName, String permission) {
        if (!(permissionsAvailable())) {
            return new ArrayList<String>(0);
        }
        ServicesManager sm = Bukkit.getServicesManager();
        Permission p = sm.getRegistration(Permission.class).getProvider();
        List<String> result = new ArrayList<String>();
        for (World world : Bukkit.getWorlds()) {
            String name = world.getName();
            if (p.has(name, userName, permission)) {
                result.add(name);
            }
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of net.milkbowl.vault.permission.Permission

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.