Class AccessControlService
- Namespace
- Shard.Server.Modules.AccessControl
- Assembly
- Shard.Server.Modules.dll
Runtime in-memory access control with JSON persistence: bans and an optional whitelist, keyed by player UUID. Thread-safe.
public sealed class AccessControlService : IAccessControlService
- Inheritance
-
AccessControlService
- Implements
- Inherited Members
Constructors
AccessControlService(IPermissionService?, string)
public AccessControlService(IPermissionService? permissions = null, string path = "access_control.json")
Parameters
permissionsIPermissionServicepathstring
Properties
Banned
public IReadOnlyCollection<Guid> Banned { get; }
Property Value
Whitelisted
public IReadOnlyCollection<Guid> Whitelisted { get; }
Property Value
Methods
Ban(Guid, string?)
public bool Ban(Guid uuid, string? reason = null)
Parameters
Returns
DisableWhitelist()
public void DisableWhitelist()
EnableWhitelist()
public void EnableWhitelist()
IsAllowed(Guid)
Return whether the UUID is allowed to join/play: false if banned; if any whitelisted entries exist then only whitelisted UUIDs (or ops) are allowed.
public Reason IsAllowed(Guid uuid)
Parameters
uuidGuid
Returns
IsBanned(Guid)
public bool IsBanned(Guid uuid)
Parameters
uuidGuid
Returns
IsWhitelistEnabled()
public bool IsWhitelistEnabled()
Returns
IsWhitelisted(Guid)
public bool IsWhitelisted(Guid uuid)
Parameters
uuidGuid
Returns
Unban(Guid)
public bool Unban(Guid uuid)
Parameters
uuidGuid
Returns
Unwhitelist(Guid)
public void Unwhitelist(Guid uuid)
Parameters
uuidGuid
Whitelist(Guid)
public void Whitelist(Guid uuid)
Parameters
uuidGuid