Badger Docs
Search…
ACE Permissions
Principals
A principal is identifiers that hold permissions (permissions will be referred to as aces). These identifiers can either be player identifiers (identification that represents a player's account such as their discord ID or steam ID for example). They can also be made up identifiers. Made up identifiers can be thought of as groups. You can make groups simply when you add a principal.
Example of adding a principal to a player and a group
1
add_principal identifier.discord:394446211341615104 group.admin
2
3
# The above line in a server.cfg or permission.cfg will add the player
4
# who has the discord identifier 394446211341615104 to the group.admin group.
5
# It should also be noted that lines denoted with a # are commented and will be
6
# skipped by the .cfg parser.
7
8
add_principal group.admin group.moderator
9
10
# The above line will make moderator aces inherited by the admin group.
11
# So group.admin will get all of the same permissions that group.moderator gets.
Copied!
ACE Permissions
Now clearly you want to give yourself permissions to use certain commands in scripts using the ACE permissions system of FiveM. To do this, you can either add the ACE permission directly to one of your identifiers or to a group, then add yourself to the group. In most cases, you will probably utilize a group since then they can be set to multiple players without having to add a permission node for each player's identifiers.
1
add_ace group.admin "BadgerTools.Spectate" allow
2
3
# The above line would give the group.admin permission to use /spectate
4
# in the BadgerTools script.
5
6
add_principal identifier.discord:394446211341615104 group.admin
7
8
# The above line now sets the player to inherit all the permissions set up with
9
# group.admin.
10
11
add_ace identifier.discord:394446211341615104 "BadgerTools.Spectate" allow
12
13
# The above line will add permission to use /spectate for only the player
14
# that matches having a discord identifier.
15
16
remove_ace group.admin "BadgerTools.Spectate" allow
17
18
# The above line will remove the allow status of a permission from the
19
# group.admin.
20
21
remove_ace identifier.discord:394446211341615104 "BadgerTools.Spectate" allow
22
23
# The above line will do the same as mentioned above, but will remove
24
# the allow status of the permission from the player that matches having
25
# the specified discord identifier ID.
Copied!
Last modified 1yr ago
Copy link