PluginPermissions
Namespace Mc.Scripting.Permissions · Kind class (sealed)
public sealed class PluginPermissionsPermissions as seen by one plugin (plugin.Permissions): declare the nodes it uses, query players, and optionally replace the backend. Everything declared here is removed when the plugin unloads or hot-reloads.
Properties
Section titled “Properties”| Member | Description |
|---|---|
FilePermissionProvider BuiltIn { get; } |
The built-in file backend (groups and player overrides stored in permissions.json). |
BuiltIn
Section titled “BuiltIn”public FilePermissionProvider BuiltIn { get; }The built-in file backend (groups and player overrides stored in permissions.json).
Methods
Section titled “Methods”| Member | Description |
|---|---|
bool Has(Player player, string node) |
Whether the player has the permission. |
bool Has(Uuid player, string node) |
Whether the player (online or not) has the permission. |
void Register(Permission permission) |
Declares a permission node. |
void Register(string node, PermissionDefault default, string description = "") |
Declares a permission node with its default and a description. |
void SetProvider(IPermissionProvider provider) |
Replaces the permission backend for as long as this plugin is loaded (a LuckPerms-style plugin does this in OnEnable). |
public bool Has(Player player, string node)Whether the player has the permission.
Parameters
| Name | Type | Description |
|---|---|---|
player |
Player |
The player. |
node |
string |
The node. |
Returns bool
public bool Has(Uuid player, string node)Whether the player (online or not) has the permission.
Parameters
| Name | Type | Description |
|---|---|---|
player |
Uuid |
The profile id. |
node |
string |
The node. |
Returns bool
Register
Section titled “Register”public void Register(Permission permission)Declares a permission node.
Parameters
| Name | Type | Description |
|---|---|---|
permission |
Permission |
The node, default and description. |
Register
Section titled “Register”public void Register(string node, PermissionDefault default, string description = "")Declares a permission node with its default and a description.
Parameters
| Name | Type | Description |
|---|---|---|
node |
string |
The dotted node, e.g. “homes.use”. |
default |
PermissionDefault |
What the node is worth when no group or player entry decides. |
description |
string = "" |
What the permission allows. |
SetProvider
Section titled “SetProvider”public void SetProvider(IPermissionProvider provider)Replaces the permission backend for as long as this plugin is loaded (a LuckPerms-style plugin does this in OnEnable).
Parameters
| Name | Type | Description |
|---|---|---|
provider |
IPermissionProvider |
The backend. |
See also
Section titled “See also”FilePermissionProvider · IPermissionProvider · Permission · PermissionDefault · Player · Uuid