Groups
Implement groups from the web panel in your resources.
Similar to permissions, groups are managed via ACEs and can be checked using the native IS_PLAYER_ACE_ALLOWED or the export from fxManager resource: exports.fxmanager:hasGroup(source, groupName).
How to use the groups
Two options are offered to check groups:
- Using the native
IS_PLAYER_ACE_ALLOWED - Using the export from fxManager resource:
exports.fxmanager:hasGroup(source, groupName)source: string | numbergroupName: string
Code example:
-- using the export
local hasGroup = exports.fxmanager:hasGroup(source, "moderator")
-- using the native
local hasGroup = IsPlayerAceAllowed(source, "fxmanager.groups.moderator")Here is an updated version of your documentation. I have streamlined the explanation, clearly documented the behavior of the slugifyGroupName function, and added a practical example so admins understand exactly how their labels turn into permission slugs.
Finding Group Names
Group names (slugs) are automatically generated from their associated display labels upon creation. Because permissions are tied directly to these generated names, updating a group's label after creation will break any existing permission implementations!
Conversion Reference
To find a group's name, apply the logic above to your label. Here are a few common examples of how labels translate to permission slugs in the webpanel:
| Group Label | Generated Group Name (Slug) |
|---|---|
Super Admin | super_admin |
Moderator - Tier 1 | moderator_tier_1 |
Content Manager!! | content_manager |