IsPlayerAceAllowed in other resources and the permission option of callbacks, net events and commands.
Setup
ug-core needs permission to runadd_ace, add_principal and their remove_ versions. Grant those four and nothing else:
server.cfg
permissions.cfg. add_ace resource.ug-core command allow also works, but grants every command.
Without them, boot prints ug-core cannot run add_ace. Add add_ace resource.ug-core command allow to server.cfg. in red, and nothing can be applied.
Groups
Define your staff groups inconfig/permissions.lua. ug-core generates it with three groups:
config/permissions.lua
Group names are lowercase letters, digits and underscores. Each group becomes the principal
group.<name>: on boot, ug-core runs add_ace group.admin ug.admin allow for each permission, and add_principal group.admin group.moderator for inherits.
The
groups option replaces the default groups entirely, so it MUST list every group you want. Invalid groups and inheritance cycles, such as a -> b -> a, stop boot with a clear error.Add players to groups
Admin menus and commands add and remove members at runtime. Memberships are stored inug_group_members and applied again on every boot:
add_principal identifier.license:abc123 group.admin, so the player has every permission of admin and of the groups it inherits.
Weight
ACE has no ranking, so groups have aweight. Admin menus use it to stop a moderator from kicking an admin:
CanTarget needs a strictly higher weight. The server console outranks everyone.
Changing groups
- New groups and permissions apply on
restart ug-core. - Removed groups and permissions stay in the ACL until the server restarts, since FXServer keeps ACEs and principals across resource restarts.
- Removing a group from the config never deletes its members. They are kept, not applied, and boot warns about them. Add the group back and they apply again.
server.cfg still works
Groups and principals fromserver.cfg keep working next to UgCore groups. A config group with the same name, such as admin, adds its permissions to the one in server.cfg.
server.cfg
Single permissions
Give one permission to one player, without a group:ug_permissions. UgCore.Permissions.Has(source, permission) is a plain ACE check, so groups, grants and server.cfg all count.
Commands
Chat commands accept apermission, a list of groups, or both. Any listed group is enough, and inheritance counts:
Inspect
Permissions used by ug-core
Resources declare their own permissions on callbacks, net events and commands with the
permission option.
Safety
Group names, permissions and identifiers end up in a server command, so UgCore only accepts letters, digits, dots, dashes and underscores, andtype:value identifiers. Anything else raises, or stops boot when it comes from the config, before reaching ExecuteCommand.