use of com.builtbroken.mc.lib.access.AccessProfile in project Engine by VoltzEngine-Project.
the class GroupProfileHandler method generateNew.
public void generateNew() {
profile = new AccessProfile();
// Create owner group - Power to do everything, AKA /OP
AccessGroup owner_group = new AccessGroup("Owner");
owner_group.addNode(PermissionsRegistry.ALL);
// Create admin group - Power to Ban, Make Regions, and adjust settings
AccessGroup admin_group = new AccessGroup("Admin");
admin_group.addNode("root.minecraft.difficulty");
admin_group.addNode("root.minecraft.setworldspawn");
admin_group.addNode("root.minecraft.give");
admin_group.addNode("root.minecraft.gamemode");
admin_group.addNode("root.minecraft.summon");
admin_group.addNode("root.minecraft.spawnpoint");
// Create mod group - Power to kick, temp-ban, and silence users
AccessGroup mod_group = new AccessGroup("Moderator");
mod_group.addNode("root.minecraft.whitelist");
mod_group.addNode("root.minecraft.ban-ip");
mod_group.addNode("root.minecraft.pardon-ip");
mod_group.addNode("root.minecraft.time");
mod_group.addNode("root.minecraft.save-all");
mod_group.addNode("root.minecraft.pardon");
mod_group.addNode("root.minecraft.ban");
mod_group.addNode("root.minecraft.weather");
mod_group.addNode("root.minecraft.toggledownfall");
mod_group.addNode("root.minecraft.tp");
// Create dev group - sub version of user just for show
AccessGroup dev_group = new AccessGroup("Dev");
dev_group.addNode("root.minecraft.debug");
// Create media group - sub version of user just for show
AccessGroup media_group = new AccessGroup("Media");
media_group.addNode("root.minecraft.seed");
// Create user group - default group
AccessGroup user_group = new AccessGroup("User");
user_group.addNode("root.minecraft.help");
user_group.addNode("root.minecraft.me");
user_group.addNode("root.minecraft.tell");
// Extend groups
owner_group.setToExtend(admin_group);
admin_group.setToExtend(mod_group);
mod_group.setToExtend(user_group);
dev_group.setToExtend(user_group);
media_group.setToExtend(user_group);
// Add groups to profile
profile.addGroup(owner_group);
profile.addGroup(admin_group);
profile.addGroup(mod_group);
profile.addGroup(dev_group);
profile.addGroup(user_group);
}
use of com.builtbroken.mc.lib.access.AccessProfile in project Engine by VoltzEngine-Project.
the class RegionManager method generateDefaultAccessProfile.
public static AccessProfile generateDefaultAccessProfile() {
AccessProfile profile = new AccessProfile();
// Create owner group
AccessGroup owner_group = new AccessGroup("owner");
owner_group.addNode(Permissions.profile.toString());
// Create admin group
AccessGroup admin_group = new AccessGroup("admin");
owner_group.addNode(Permissions.group.toString());
// Create user group
AccessGroup user_group = new AccessGroup("user");
user_group.addNode(rightClick.toString());
user_group.addNode(leftClick.toString());
user_group.addNode(break_block.toString());
// Set groups to extend each other
admin_group.setToExtend(user_group);
owner_group.setToExtend(admin_group);
// Add groups to profile
profile.addGroup(user_group);
profile.addGroup(admin_group);
profile.addGroup(owner_group);
return profile;
}
Aggregations