Permissions


About the permissions system

vMenu uses the default Aces & Principals system available in FiveM. I’ve made a full guide about what they are, and how resource developers can use them (that guide can be found here). Although you don’t need to know evertyhing inside that guide to setup vMenu permissions, I still recommend looking through that guide if you want to learn more advanced tricks about using and setting up aces & principals for vMenu.

The basics

Here you’ll find the short version of what you need to understand before you can start creating your permissions:

  1. Permissions are called Aces
    Aces (vMenu.PlayerOptions.Menu, for example) are what you want to give to your players. Having such Ace/permission, you’ll be able to access different parts of the menu and perform different actions.
  2. Groups are called Princials
    Giving permissions to every single player would be a waste of time and just completely useless. That’s where Principals (groups) come in to play. You can give permissions to a specific Principal, and add Players to a principal. You can also add principals to other principals, allowing a inheritance-like permissions system to improve your setup.
    You can create as many groups/Principals as you want, and you can also name them whatever you want.

Important info when setting up permissions

The default permissions.cfg file provided in the resource download, will have all the information you need to get started, but we’ll explain some things here as well.

First of all, all changes you make to the permissions.cfg file will require a server restart. Simply restarting the resource (which is NOT RECOMMENDED anyway) will not update the changes you’ve made to the permissions. This is because the permissions file only gets executed when the server is (re)started. A silly mistake some people make, is that they confuse the "PERMISSIONS.md" file for the permissions.cfg file. "PERMISSIONS.md" has NOTHING to do with the actual configuration of the permissions, it is just a REFERENCE file containing a list of all possible permissions that you can use. Also make sure to always edit the permissions.cfg file located in the same folder as your server.cfg file. Editing the file inside your /config/ folder will do absolutely nothing.

Permissions that are granted to the builtin.everyone group, are added to all players. There’s no way to restrict this. builtin.everyone really means “everyone”.

Setting up permissions

To create a Principal/Group and add a player to it, add this somewhere at the top of your permissions.cfg file, in this example we’ll use the steam identifier:

add_principal identifier.steam:<steam_id_here> group.<groupName>

For example, if I wanted to add myself to the “admin” group, I’d do it like this:

add_principal identifier.steam:110000101234567 group.admin

Then if I wanted to give myself access to the full “Online Players” menu, I would give myself the ace for it like this:

add_ace group.admin "vMenu.OnlinePlayers.Menu" allow
add_ace group.admin "vMenu.OnlinePlayers.All" allow

Summary: My permissions.cfg file would now look like this:

add_principal identifier.steam:110000101234567 group.admin
add_ace group.admin "vMenu.OnlinePlayers.Menu" allow
add_ace group.admin "vMenu.OnlinePlayers.All" allow

If I wanted to allow everything in the Online Players menu EXCEPT for the teleporting option, then I’d have to add all allowed permissions manually, and LEAVE OUT the ones I don’t want. There’s no way to allow “everything (.All)” and then “deny” certain permissions. Example:

# Add players to group
add_principal identifier.steam:110000101234567 group.admin


# Allow all permissions EXCEPT for the teleport to player permission
add_ace group.admin "vMenu.OnlinePlayers.Menu" allow
#add_ace group.admin "vMenu.OnlinePlayers.All" allow
#add_ace group.admin "vMenu.OnlinePlayers.Teleport" allow
add_ace group.admin "vMenu.OnlinePlayers.Waypoint" allow
add_ace group.admin "vMenu.OnlinePlayers.Spectate" allow
add_ace group.admin "vMenu.OnlinePlayers.Summon" allow
add_ace group.admin "vMenu.OnlinePlayers.Kill" allow
add_ace group.admin "vMenu.OnlinePlayers.Kick" allow
add_ace group.admin "vMenu.OnlinePlayers.TempBan" allow
add_ace group.admin "vMenu.OnlinePlayers.PermBan" allow
add_ace group.admin "vMenu.OnlinePlayers.Unban" allow

See how the .Teleport line is commented out? That will deny that option in the menu. Note that you also MUST comment out the .All permission for a (sub)menu if you want to deny a permission. .All permissions will always override every other option inside the menu to allow.

Very important

DO NOT SET ANY PERMISSION TO deny!!!! Always leave it as allow but just COMMENT OUT (put a # in front of the line) a permission if you don’t want players to have it!!!