Class ServerAccessCatalog
- Namespace
- McServerLauncher.Services
- Assembly
- McServerLauncher.dll
One row per permission and per role: what it is called on the wire, how dangerous it is, and what a role starts with.
public static class ServerAccessCatalog
- Inheritance
-
ServerAccessCatalog
- Inherited Members
Remarks
Same instinct as ServerTypeCatalog: a single table that everything reads from. The cloud, the web and the phone are going to ask the same questions, and they must not each keep their own list.
This has no text a person reads. Names and descriptions come with the screen that shows them, in the .resx files like everything else; the ids below are for machines and never change.
Fields
All
Every permission there is.
public static readonly ServerPermission All
Field Value
Critical
The critical permissions together: free commands and installing content.
public static readonly ServerPermission Critical
Field Value
Permissions
The permissions, in the order a screen should list them.
public static readonly ServerAccessCatalog.PermissionEntry[] Permissions
Field Value
Roles
The roles, from the one that can do least to the one that can do most.
public static readonly ServerRole[] Roles
Field Value
Methods
FromIds(IEnumerable<string>?)
The set named by these ids. An id this version does not know is skipped.
public static ServerPermission FromIds(IEnumerable<string>? ids)
Parameters
idsIEnumerable<string>
Returns
Remarks
Skipped, not an error: a newer cloud may send a permission an older app has never heard of, and the safe reading of "something I don't understand" is that it grants nothing.
ParseRole(string?)
The role with this id, or null for one this version has never heard of.
public static ServerRole? ParseRole(string? id)
Parameters
idstring
Returns
Preset(ServerRole)
What a role starts with.
public static ServerPermission Preset(ServerRole role)
Parameters
roleServerRole
Returns
Remarks
The critical permissions are in none of these but the owner's. An admin who needs one gets it as an override from the owner, which leaves a record of who decided that.
RoleId(ServerRole)
The wire id of a role: its name in lower case.
public static string RoleId(ServerRole role)
Parameters
roleServerRole
Returns
ToIds(ServerPermission)
The ids of the permissions in a set, in catalog order.
public static string[] ToIds(ServerPermission set)
Parameters
setServerPermission
Returns
- string[]