Skip to main content
Server Part of Permissions.

Groups

Groups come from config/permissions.lua. Read them with GetGroupDefinition.

AddGroup

MUST run in a thread. Adds the target to the group and applies it right away. Adding a member again does nothing and returns true.
string
required
A group from config/permissions.lua.
string
Who added it. Up to 64 characters.

RemoveGroup

MUST run in a thread. removed is false when the target was not a member. Also deletes stored memberships of groups no longer in the config.

GetGroups

The target’s groups, highest weight first. Inherited groups are not listed.

IsInGroup

True for direct members and through inheritance: a founder that inherits admin is also in admin.

GetWeight

The highest weight of the target’s groups. 0 without groups.

CanTarget

True when actor has a strictly higher weight than target. Source 0, the server console, outranks everyone and is outranked by no one.

GetGroupDefinition

A copy of the group from the config. nil for unknown groups.
IsInGroup, GetGroups, GetWeight and CanTarget only know memberships managed by UgCore, not add_principal lines in server.cfg.