TnmsAdministrationPlatform.Shared
0.0.2
dotnet add package TnmsAdministrationPlatform.Shared --version 0.0.2
NuGet\Install-Package TnmsAdministrationPlatform.Shared -Version 0.0.2
<PackageReference Include="TnmsAdministrationPlatform.Shared" Version="0.0.2" />
<PackageVersion Include="TnmsAdministrationPlatform.Shared" Version="0.0.2" />
<PackageReference Include="TnmsAdministrationPlatform.Shared" />
paket add TnmsAdministrationPlatform.Shared --version 0.0.2
#r "nuget: TnmsAdministrationPlatform.Shared, 0.0.2"
#:package TnmsAdministrationPlatform.Shared@0.0.2
#addin nuget:?package=TnmsAdministrationPlatform.Shared&version=0.0.2
#tool nuget:?package=TnmsAdministrationPlatform.Shared&version=0.0.2
TnmsAdministrationPlatform
What is this?
It is a common infrastructure for centralized management of administrator information such as permissions.
Features
User Data Management
Administrator information for users is centrally managed using a database.
Node-based Permission Settings
This system adopts node-based permission settings. Nodes have a hierarchical structure, and permissions can be set for each node. This enables flexible access control.
Mechanism
In this system, nodes are defined and utilized as follows:
Examples:
tnms.admintnms.administrationplatform.command.testcommand1tnms.administrationplatform.command.testcommand2
You can also use wildcards to set permissions as shown below:
*: Has all permissionstnms.*: All permissions related to tnmstnms.administrationplatform.*: All permissions related to AdministrationPlatformtnms.administrationplatform.command.*: All permissions related to AdministrationPlatform commands
Built-in Permissions
tnms.admin: Used to determine whether a user can be targeted in the AdministrationPlatform.- Users who do not have this permission cannot target users who do have it.
Usage
Config
TODO
Plugin Development
Dependencies
Install TnmsAdministrationPlatform.Shared from NuGet.
dotnet add package TnmsAdministrationPlatform.Shared
Permission Verification
You can obtain the AdminSystem as follows:
private IAdminManager _adminManager = null!;
public void OnAllModulesLoaded()
{
var adminSystem = _sharedSystem.GetSharpModuleManager().GetRequiredSharpModuleInterface<IAdminManager>(IAdminManager.ModSharpModuleIdentity).Instance;
_adminManager = adminSystem ?? throw new InvalidOperationException("TnmsAdministrationPlatform is not found! Make sure TnmsAdministrationPlatform is installed!");
}
You can verify permissions as follows:
When using wildcards, except for root permissions, the permission string must end with .*.
if (_adminManager.ClientHasPermission(player, "node.to.check"))
// Example with wildcard
if (_adminManager.ClientHasPermission(player, "node.to.*"))
// Example with root permission
if (_adminManager.ClientHasPermission(player, "*"))
For more details, please refer to the code documentation.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- ModSharp.Sharp.Shared (>= 2.1.79)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on TnmsAdministrationPlatform.Shared:
| Package | Downloads |
|---|---|
|
TnmsPluginFoundation
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.