Skip to content

IPermissionProvider

Namespace Mc.Scripting.Permissions · Kind interface

public interface IPermissionProvider

A permission backend: answers “does this player have this node?” with an explicit value or no opinion. Implement it to replace the built-in file-based backend (for example with a database or a LuckPerms-style system) and install it with PermissionManager.SetProvider.

Member Description
string Name { get; } A short name for logs and admin tools.
string Name { get; }

A short name for logs and admin tools.

Member Description
PermissionValue Get(Uuid player, string node) The explicit value of node for the player: wildcards (a.b.*, *) and groups are the provider’s business.
IReadOnlyCollection<string> Groups(Uuid player) The names of the groups the player belongs to (for display and admin commands).
PermissionValue Get(Uuid player, string node)

The explicit value of node for the player: wildcards (a.b.*, *) and groups are the provider’s business. Return PermissionValue.Unset when nothing matches, so the node’s registered default decides.

Parameters

Name Type Description
player Uuid The player’s profile id.
node string The dotted permission node.

Returns PermissionValue: The value.

IReadOnlyCollection<string> Groups(Uuid player)

The names of the groups the player belongs to (for display and admin commands).

Parameters

Name Type Description
player Uuid The player’s profile id.

Returns IReadOnlyCollection<string>: The group names.

Member Description
event Action<Uuid?>? Changed Raised when permissions changed (the player’s id, or null when a group or everything changed): the server refreshes the command trees.
public event Action<Uuid?>? Changed;

Raised when permissions changed (the player’s id, or null when a group or everything changed): the server refreshes the command trees.

Returns Action<Uuid?>?

PermissionValue · Uuid