Features

The permission system of Plugify: users, groups and permissions in the core plugin, a database storage and the Counter-Strike 2 connector.

The permission system is built from three plugins that work together. The Permissions plugin is the core: it keeps users, groups and permissions in memory and answers the question "may this player do that?". Two more plugins connect it to the outside world.

PluginPackageWhat it does
permissionsplugify-plugin-permissionsThe core: users, groups, permissions, cookies and the API other plugins call
permissions_storagepermissions-storageSaves groups and users to MySQL, PostgreSQL or SQLite and loads them back
permissions_connector_s2permissions-connector-s2Connects the core to a Counter-Strike 2 server: loads players when they join, notifies them and adds the perms_* commands

The core knows nothing about the game or the database. This keeps it usable in any application, and lets you replace the storage or the connector with your own plugin.

How they work together

  1. The server starts a map. The connector asks the core to load groups, and the storage answers by reading them from the database.
  2. A player joins. The connector asks the core to load the user by SteamID64, and the storage fills in the player's groups, permissions and cookies.
  3. A plugin checks a permission with HasPermission. The core answers from memory.
  4. An admin changes something, with a command or through the API. The core first lets the storage save the change, then applies it and notifies everyone who listens.
  5. The player leaves, and the connector removes the user from memory.

What the core offers

  • Permissions as dotted lines: admin.kick, shop.buy.weapon.
  • Wildcards: admin.* covers everything under admin., and * covers everything.
  • Denials: a line that starts with - forbids the permission, for example -admin.ban.
  • Groups with a priority, a parent group to inherit from and their own options.
  • Temporary permissions and groups that expire by themselves at a given time.
  • Immunity: a player can act only on players whose immunity is not higher.
  • Cookies: named values stored per user, with group options as the fallback.
  • Events for every change, and storage callbacks that can reject a change.

What the connector adds

  • Players are loaded when they authenticate and unloaded when they leave.
  • Players are told in console, chat or a hint when a permission or group is granted, removed or expires.
  • Console and chat commands to manage users and groups, each protected by its own permission.
  • English and Russian phrases, which you can override.