Repository navigation
Releases
perms v0.2.2
For amxts 0.3.5 and later.
0.2.1 was published broken: npm install failed on it. 0.2.2 is the same code, published properly.
👉 Changelog
❤️ Contributors
- Ernest Manukyan (@kukson777)
perms v0.2.1
For the 0.3 line of the core.
🩹 Important fixes
- A hot reload of a plugin that declares permissions printed "X is declared twice" for each of them, and a declaration that changed in the reload was not taken. A plugin's declarations now go with it when it stops (6d3f491).
- A plugin that asked for a permission while perms was being hot-reloaded, before perms had read its file, stopped perms with "Unexpected 'null'". The
defaultgroup now exists from the start, so the answer is the default group's until the file is read (6d9fd57).
👉 Changelog
🩹 Fixes
- Forget a stopped plugin's declared nodes (6d3f491)
- Guard against null user fields during a reload (a70a008)
- Default group exists before the config is read (6d9fd57)
❤️ Contributors
- Ernest Manukyan (@kukson777)
perms v0.2.0
For the 0.3 cores.
🔑 A password on any entry
A SteamID can be faked on a server that lets players in without Steam, so I let any entry carry a password - a SteamID's and an IP's too, not only a name's. The player gives it with setinfo _pw; with a wrong one he plays as default. It is set and taken away from the server console, and the file keeps only its SHA-256:
perms user STEAM_0:1:12345 password secret
perms user STEAM_0:1:12345 password # no password any moreperms import keeps users.ini's passwords for SteamID and IP entries too.
The editor's page sees which entries have a password (password: true); the password itself never leaves the server.
⚠️ Breaking changes
perms importkeeps the password of a SteamID or IP entry ofusers.inithat has noeflag, as AMX Mod X does: such a player gives it withsetinfo _pw, or plays asdefault. Before, the import dropped it and let him in by his SteamID alone.
👉 Changelog
🚀 Enhancements
- A password on any entry, a SteamID's too (9706c90)
- editor: The page sees whether an entry has a password (70be0bb)
❤️ Contributors
- Ernest Manukyan (@kukson777)
perms v0.1.1
For cores of the 0.3 line from 0.3.2.
A server that runs the editor's store of its own gets its own link. With PERMS_EDITOR_URL in .env,
perms editor prints the store's address, and the store sends the browser on to the editor page
with that store:
PERMS_EDITOR_URL=https://perms.myserver.com
[perms] Open the editor (an hour): https://perms.myserver.com/editor#k3x9q2mw7a
👉 Changelog
🚀 Enhancements
- editor: A store of your own gives its own link (3f384fc)
❤️ Contributors
- Ernest Manukyan (@kukson777)
perms v0.1.0
The first release of Perms, for cores of the 0.3 line from 0.3.2.
Perms is a permissions module for amxts servers: it replaces AMX Mod X's admin.amxx with
permission nodes, groups and a web editor, the way LuckPerms does for Minecraft servers.
Pawn plugins keep working unchanged, because the module gives every player AMX Mod X's flags
from his amxx.* nodes.
👀 Highlights
🔑 Nodes, groups, weights
A permission is a node, kz.admin.kick. kz.admin.* gives everything under it, and
-kz.admin.wipe takes one away. Groups inherit from each other and have a weight; every player
is in default; and a player's own grants come before his groups. A grant or a group can last
30d and then go by itself, and on a shared database it can count on one server only.
perms.declare({
"myplugin.kick": { description: "Kick players" },
"myplugin.help": { description: "Use /help", everyone: true },
});
server.addCommand<KickArgs>("/kick <target>", ({ player, target }) => {
if (!perms.has(player, "myplugin.kick")) return player.print("You may not kick");
target.kick("Kicked");
});
perms.addGroup(player, "vip", { for: 30 * 86400 });
perms.addEventListener("change", ({ player }) => refreshTag(player));🌐 A web editor
perms editor in the server console prints a link. The page shows every plugin's permissions
with their descriptions, a column per group, and the groups and players. Saving sends the changes
back, and the server applies them within seconds, without a restart. Passwords and the database's
address never leave the server.
🗄️ A file or MySQL
The permissions live in perms.yaml, which you can edit by hand. Or, with PERMS_DB in .env,
they live in MySQL, shared by several servers, and a change on one reaches the others within five
seconds.
🧰 In place of admin.amxx
perms import users.ini turns AMX Mod X's admins into entries, with their flags as amxx.*
permissions. access, cmd_access, amx_mode, amx_password_field, amx_default_access and
amx_reloadadmins keep working. Pawn plugins can check nodes themselves through perms.inc:
perms_has, the groups, and the perms_changed forward.
Permissions change from the server console and in the editor. In the game, a player with
perms.view can look them up.
👉 Changelog
🚀 Enhancements
- Perms, permissions and groups for amxts servers (87bd13f)
- Permissions change from the server console and the editor only (59bdf72)
- The editor's store at perms-store.brokukaschannel.workers.dev (69dd613)
- editor: The page is amxts.github.io/modules/perms/editor (9fba515)
🩹 Fixes
- SteamIDs from the console, and say which file is read (5da51ef)
- editor: Bots are not players (cc0b0e3)
❤️ Contributors
- Ernest Manukyan (@kukson777)