Getting Started

A step-by-step walkthrough of the permission system for server owners: key concepts, the first admin, groups, inheritance, denials and temporary access.

This page takes you from a fresh server to a working set of groups, one command at a time. The full list of commands and settings is in the Guide.

Key concepts

Permission

Plugins protect their commands and features with permissions. A permission is a line of words separated by dots, for example admin.kick. The plugin chooses the line, and you decide who has it.

A permission has three possible answers for a player:

  • allowed: the player or one of the player's groups has the line;
  • denied: the line is given with a - in front, for example -admin.kick;
  • not set: nobody mentioned it. Plugins treat this the same as denied.

A * at the end is a wildcard: admin.* covers every permission that starts with admin., and * alone covers everything.

Group

Giving permissions to every player one by one does not scale. A group is a named set of permissions that you give to a player as a whole: put admin.kick and admin.ban into the Moderator group, then add players to Moderator.

A player can be in several groups at once and can also have personal permissions on top of them.

Inheritance

A group can have a parent group and receives all permissions of the parent. If Admin has the parent Moderator, and Moderator has the parent Default, an admin has the permissions of all three.

Each group has one parent. To combine unrelated sets of permissions, add the player to several groups.

Priority

Every group has a priority, a number you choose when you create it. When two groups of a player disagree about a permission, the group with the higher priority wins. A common layout is 0 for the default group and larger numbers for higher ranks.

Default group

On a fresh database there is one group, Default, with priority 0. Every player receives it when they join. Permissions you put into Default apply to everyone.

Before you start

  • The three plugins must be installed. They are part of the Plugify Source 2 build, see Installation to add them yourself.
  • Type the commands of this page into the server console. The console is allowed to do everything, so it is the place where the first admin is created.
  • A player must be on the server to be changed. Players are loaded when they join and unloaded when they leave.
  • <player> in a command is a name, #slot, $steamid64 or &account_id. Run perms_users to see the players on the server with their slots and SteamID64.

Step 1: Give yourself access

Join the server, then run this in the server console with your own SteamID64:

perms_user_add_permission $76561198000000000 permissions.* 0

You now have every permission that starts with permissions., which is all the perms_* commands. The last argument is the duration, and 0 means forever.

From now on you can type the commands in the game as well, in the console or in chat. Run perms to see the commands available to you.

Step 2: Create a group

perms_creategroup Admin 100 "" "admin.* permissions.*"

The arguments are the group name, its priority, the parent group and the permissions:

  • Admin is the name.
  • 100 is the priority.
  • "" means the group has no parent.
  • "admin.* permissions.*" is the list of permissions, in quotes and separated by spaces. Pass "" to create an empty group.

Add and remove permissions of the group later with:

perms_group_add_permission Admin shop.*
perms_group_remove_permission Admin shop.*

perms_group_permissions Admin shows what the group has now, and perms_groups lists all groups.

Step 3: Add a player to the group

perms_user_add_group $76561198000000000 Admin 0

The player now has every permission of Admin. To take the group away again:

perms_user_remove_group $76561198000000000 Admin

perms_user_groups <player> shows the groups of a player.

Step 4: Build a ladder of groups

Suppose the server needs four ranks. The permission lines here are examples, yours come from the plugins you use.

DefaultVIPModeratorAdmin
shop.buyshop.discountadmin.kickadmin.*
chat.coloradmin.mutepermissions.*

Every rank should also have the permissions of the ranks below it. That is what the parent is for:

perms_group_add_permission Default shop.buy
perms_creategroup VIP 10 Default "shop.discount chat.color"
perms_creategroup Moderator 50 VIP "admin.kick admin.mute"
perms_group_parent_set Admin Moderator

Default already exists, so it only receives a permission. VIP and Moderator are created with their parent right away. Admin exists since step 2, so its parent is set with a separate command.

Inheritance goes all the way up: a moderator has the permissions of Moderator, VIP and Default. A parent chain that loops back to the same group is refused.

Step 5: Take one permission away

A wildcard gives everything under it. To keep the wildcard and remove one permission, add a denial, the same line with - in front:

perms_group_add_permission Admin -admin.ban

Admins now have everything under admin. except admin.ban. The same works for one player:

perms_user_add_permission <player> -chat.color 0

If the group or player already has the line with the opposite answer, add refuses to change it. Use perms_group_set_permission or perms_user_set_permission, which replace the current answer.

Step 6: Give temporary access

Groups and permissions of a player can expire by themselves. Pass a duration instead of 0:

perms_user_add_group <player> VIP 2592000

The duration is in seconds by default, so this is 30 days. To type durations in minutes, hours or days, change time_mode in the connector settings.

When the time runs out, the group is removed and the player is told about it. perms_user_set_group replaces the duration of a group the player already has.

Step 7: Check the result

Do not guess whether a setup works, ask the system:

perms_user_check_permission <player> admin.kick
perms_user_info <player>
perms_group_check_permission Moderator admin.kick

perms_user_info prints everything about a player: groups, personal permissions, cookies and immunity.

When rules disagree

A player can get different answers for the same permission from different places. The first place that has an answer wins:

  1. temporary permissions of the player;
  2. permanent permissions of the player;
  3. the player's groups, from the highest priority to the lowest. Each group answers first, then its parent, then the parent of the parent.

Inside one player or one group, the exact line beats a wildcard: admin.* together with -admin.ban denies admin.ban and allows the rest.

SetupCheckAnswerWhy
Player: -shop.buy. Group Default: shop.buyshop.buydeniedThe player's own permissions come before groups
Admin (100): admin.*. Muted (5): -admin.kick. The player is in bothadmin.kickallowedAdmin has the higher priority and already has an answer
Admin (100): admin.*. Muted (200): -admin.kick. The player is in bothadmin.kickdeniedNow Muted is asked first
VIP: -shop.discount, parent Default: shop.*shop.discountdeniedA group answers before its parent

The second row is the most common surprise: a denial in a low group does not override a higher group. Give the restricting group a higher priority, or put the denial on the player.

Immunity

Immunity decides whom an admin may act on. An admin can act on a player only when the admin's immunity is equal or higher. A new player has immunity 0. Immunity is set by plugins through the API, there is no console command for it.

Group options

Besides permissions, a group can carry options: named values that plugins read, such as a chat tag or a limit.

perms_group_set_option VIP tag "[VIP]"
perms_group_option VIP tag

An option does nothing by itself. The plugin that uses it documents the name and the meaning of the value. Players can also have personal values, called cookies, and a player's cookie overrides the option of the same name from the groups.

Several servers

With MySQL or PostgreSQL several servers can share one database. Every server has its own server_id in the storage settings:

  • groups and permissions given on server 0 apply on every server;
  • the ones given on another id apply only there;
  • removing a group or permission from a player removes it on all servers. To take a permission away on one server only, add a denial on that server.

SQLite is always a single server.

Finding permission lines

  • Read the documentation of the plugin. Plugins usually start their lines with the plugin name.
  • The permissions of the perms_* commands are listed in the commands table.
  • Give a trusted admin group a wildcard for the whole plugin, for example shop.*, and add denials for the few things it should not do.

Common problems

The player is not found. The player must be on the server. Check the spelling, or use #slot or $steamid64 from perms_users.

A command typed in chat answers that you have no permission. Every perms_* command needs its own permission. Give yourself permissions.* from the server console, as in step 1.

You are not allowed to act on a player. The target has higher immunity than you.

A permission is given but the player still cannot use the feature. Run perms_user_check_permission. If the answer is denied, look for a denial on the player or in a group with a higher priority, see When rules disagree. If the answer is allowed, the plugin checks a different line.

A group cannot be deleted. It still has players, or it is the default group.

Nothing is saved after a restart on MySQL or PostgreSQL. The plugin does not create the tables in these databases. Create them as described in Storage.

No output over RCON. The answer of a perms_* command is printed to the server console and is not returned to the RCON client.