Overhauled permissions.

Overhauled permissions to use permission nodes, and separated some
permissions into smaller ones (such as cfg into tshock.cfg.maxspawns,
tshock.cfg.spawnrate, etc),
This commit is contained in:
MarioE 2013-09-23 18:53:36 -04:00
parent e0809427e0
commit e1531ab675
4 changed files with 228 additions and 143 deletions

View file

@ -22,71 +22,66 @@ namespace Rests
{
public static class RestPermissions
{
[Description("User can create REST tokens.")]
public static readonly string restapi;
[Description("User or REST user can destroy all REST tokens.")]
public static readonly string restmanage;
[Description("REST user can turn off / restart the server.")]
public static readonly string restmaintenance;
[Description("REST user can reload configurations, save the world and set auto save settings.")]
public static readonly string restcfg;
[Description("REST user can list and get detailed information about users.")]
public static readonly string restviewusers;
[Description("REST user can alter users.")]
public static readonly string restmanageusers;
// tshock.rest.bans nodes
[Description("REST user can list and get detailed information about bans.")]
public static readonly string restviewbans;
public static readonly string restviewbans = "tshock.rest.bans.view";
[Description("REST user can alter bans.")]
public static readonly string restmanagebans;
public static readonly string restmanagebans = "tshock.rest.bans.manage";
// tshock.rest.groups nodes
[Description("REST user can list and get detailed information about groups.")]
public static readonly string restviewgroups;
public static readonly string restviewgroups = "tshock.rest.groups.view";
[Description("REST user can alter groups.")]
public static readonly string restmanagegroups;
public static readonly string restmanagegroups = "tshock.rest.groups.manage";
// tshock.rest.users nodes
[Description("REST user can list and get detailed information about users.")]
public static readonly string restviewusers = "tshock.rest.users.view";
[Description("REST user can alter users.")]
public static readonly string restmanageusers = "tshock.rest.users.manage";
[Description("REST user can get user information.")]
public static readonly string restuserinfo;
public static readonly string restuserinfo = "tshock.rest.users.info";
// Non-grouped nodes
[Description("User can create REST tokens.")]
public static readonly string restapi = "tshock.rest.useapi";
[Description("User or REST user can destroy all REST tokens.")]
public static readonly string restmanage = "tshock.rest.manage";
[Description("REST user can turn off / restart the server.")]
public static readonly string restmaintenance = "tshock.rest.maintenance";
[Description("REST user can reload configurations, save the world and set auto save settings.")]
public static readonly string restcfg = "tshock.rest.cfg";
[Description("REST user can kick players.")]
public static readonly string restkick;
public static readonly string restkick = "tshock.rest.kick";
[Description("REST user can ban players.")]
public static readonly string restban;
public static readonly string restban = "tshock.rest.ban";
[Description("REST user can mute and unmute players.")]
public static readonly string restmute;
public static readonly string restmute = "tshock.rest.mute";
[Description("REST user can kill players.")]
public static readonly string restkill;
public static readonly string restkill = "tshock.rest.kill";
[Description("REST user can drop meteors or change bloodmoon.")]
public static readonly string restcauseevents;
public static readonly string restcauseevents = "tshock.rest.causeevents";
[Description("REST user can butcher npcs.")]
public static readonly string restbutcher;
public static readonly string restbutcher = "tshock.rest.butcher";
[Description("REST user can run raw TShock commands (the raw command permissions are also checked though).")]
public static readonly string restrawcommand;
static RestPermissions()
{
foreach (var field in typeof (RestPermissions).GetFields())
{
field.SetValue(null, field.Name);
}
}
public static readonly string restrawcommand = "tshock.rest.command";
}
}