Package net.canarymod.permissionsystem

Examples of net.canarymod.permissionsystem.MultiworldPermissionProvider


     */
    public PermissionProvider loadGroupPermissions(String name, String world) {
        if (world != null && world.isEmpty()) {
            world = null;
        }
        PermissionProvider provider = new MultiworldPermissionProvider(world, false, name);
        ArrayList<DataAccess> dataList = new ArrayList<DataAccess>();
        Logman.println("Loading permissions for " + name + ". World: " + ((world != null && !world.isEmpty()) ? world : "none"));
        try {
            Database.get().loadAll(new PermissionDataAccess(world), dataList, new String[]{ "owner", "type" }, new Object[]{ name, "group" });
            for (DataAccess da : dataList) {
                PermissionDataAccess data = (PermissionDataAccess) da;

                provider.addPermission(data.path, data.value, data.id);
            }
        }
        catch (DatabaseReadException e) {
            Canary.logStacktrace(e.getMessage(), e);
        }
View Full Code Here


    public PermissionProvider loadPlayerPermissions(String name, String world) {
        if (world != null && world.isEmpty()) {
            world = null;
        }
        // Database.get().remove("permission", new String[] {"owner", "type"}, new Object[] {group.getName(), "group"});
        PermissionProvider provider = new MultiworldPermissionProvider(world, true, name);
        ArrayList<DataAccess> dataList = new ArrayList<DataAccess>();

        try {
            Database.get().loadAll(new PermissionDataAccess(world), dataList, new String[]{ "owner", "type" }, new Object[]{ name, "player" });
            for (DataAccess da : dataList) {
                PermissionDataAccess data = (PermissionDataAccess) da;

                provider.addPermission(data.path, data.value, data.id);
            }
        }
        catch (DatabaseReadException e) {
            Canary.logStacktrace(e.getMessage(), e);
        }
View Full Code Here

TOP

Related Classes of net.canarymod.permissionsystem.MultiworldPermissionProvider

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.