Add default permissions

This commit is contained in:
Pablete1234 2017-02-01 04:25:25 +01:00
parent 0a3f0c125f
commit 416fb60b51
No known key found for this signature in database
GPG Key ID: DAFF9A337EF9A5FA
2 changed files with 83 additions and 3 deletions

View File

@ -0,0 +1,80 @@
package tc.oc.api.minecraft.servers;
import java.util.Map;
import com.google.common.collect.ImmutableMap;
/**
* This is a hard-coded list of permissions, that add the basic functionality.
* To be replaced when a proper rank/group & permission system
*
* The list of permissions have been copied from what they used to be on ocn, removing blatantly outdated ones.
*/
public class DefaultPermissions {
public static final Map<String, Boolean> PARTICIPANT_PERMISSIONS;
public static final Map<String, Boolean> OBSERVER_PERMISSIONS;
public static final Map<String, Boolean> MAPMAKER_PERMISSIONS;
static {
PARTICIPANT_PERMISSIONS = new ImmutableMap.Builder<String, Boolean>()
// Global
.put("worldedit.navigation.jumpto.tool", false)
.put("worldedit.navigation.thru.tool" , false)
// Untourney
.put("bukkit.command.kill" , false)
.put("bukkit.command.me" , false)
.put("bukkit.command.tell" , false)
.put("commandbook.pong" , false)
.put("commandbook.speed.flight", false)
.put("commandbook.speed.walk" , false)
.put("chat.global.receive" , true)
.put("commandbook.motd" , true)
.put("commandbook.msg" , true)
.put("commandbook.rules" , true)
.put("commandbook.time.check" , true)
.put("commandbook.who" , true)
.put("pgm.chat.report" , true)
.put("pgm.class" , true)
.put("pgm.class.list" , true)
.put("pgm.class.select" , true)
.put("pgm.join" , true)
.put("pgm.myteam" , true)
.build();
OBSERVER_PERMISSIONS = new ImmutableMap.Builder<String, Boolean>()
// Untourney
.put("bukkit.command.kill" , false)
.put("bukkit.command.me" , false)
.put("bukkit.command.tell" , false)
.put("commandbook.pong" , false)
.put("worldedit.navigation.ceiling", false)
.put("worldedit.navigation.up" , false)
.put("commandbook.motd" , true)
.put("commandbook.msg" , true)
.put("commandbook.rules" , true)
.put("commandbook.teleport" , true)
.put("commandbook.time.check" , true)
.put("commandbook.who" , true)
.put("ocn.teleport" , true)
.put("pgm.chat.report" , true)
.put("pgm.class" , true)
.put("pgm.class.list" , true)
.put("pgm.class.select" , true)
.put("pgm.inventory" , true)
.put("pgm.join" , true)
.put("pgm.myteam" , true)
.put("worldedit.navigation.*" , true)
.build();
MAPMAKER_PERMISSIONS = new ImmutableMap.Builder<String, Boolean>()
// Public
.put("map.rating.view.live", true)
.put("pgm.fullserver" , true)
.put("pgm.join.choose" , true)
.put("pgm.join.full" , true)
.build();
}
}

View File

@ -180,17 +180,17 @@ public class LocalServerDocument extends StartupServerDocument implements Server
@Override
public Map<String, Boolean> participant_permissions() {
return Collections.emptyMap();
return DefaultPermissions.PARTICIPANT_PERMISSIONS;
}
@Override
public Map<String, Boolean> observer_permissions() {
return Collections.emptyMap();
return DefaultPermissions.OBSERVER_PERMISSIONS;
}
@Override
public Map<String, Boolean> mapmaker_permissions() {
return Collections.emptyMap();
return DefaultPermissions.MAPMAKER_PERMISSIONS;
}
@Override