Shared UCL stuff.
Shared UCL | Shared UCL stuff. |
Tables | |
ucl | Holds all of the ucl variables and functions |
Functions | |
ucl. | This function is used to see if a user has access to a command. |
ucl. | This function is used to see if a specified group is inheriting from another |
ucl. | This function returns a tree-like structure representing the group inheritance architecture. |
ucl. | Gets what a group is allowed to target in the UCL. |
Player: | This is an alias of ULib.ucl.query() |
Player: | Overwrite garry’s IsAdmin function to check for membership in admin group. |
Player: | Overwrite garry’s IsSuperAdmin function to check for membership in superadmin group. |
Player: | This should have been included with garrysmod by default, so ULib is creating it for us. |
Player: | This function is similar to IsUserGroup(), but this one checks the UCL group chain as well. |
function ucl.query( ply, access, hide )
This function is used to see if a user has access to a command.
ply | The player to check access for |
access | The access string to check for. (IE “ulx slap”, doesn’t have to be a command though). If nil is passed in, this always returns true. |
hide | (Optional, defaults to false) Normally, a listen host is automatically given access to everything. Set this to true if you want to treat the listen host as a normal user. (Will be denied commands that no one has access to) |
A bool signifying whether or not they have access.
v2.40 | Rewrite. |
function ucl.groupInheritsFrom( group )
This function is used to see if a specified group is inheriting from another
group | The group to check inheritance on. Must be a valid group. |
The group this group is inheriting from or nil (everything implicity inherits from “user”, “user” inherits from nil).
v2.40 | Initial. |
function ucl.getInheritanceTree()
This function returns a tree-like structure representing the group inheritance architecture.
The inheritance tree.
PrintTable( ULib.ucl.getInheritanceTree() ) user: trusted: members: thedumbones: admin: superadmin: serverowner: clanowner: respected:
v2.40 | Initial |
Overwrite garry’s IsAdmin function to check for membership in admin group. This is so if group “serverowner” inherits from admin, this function will still return true when checking on a member belonging to the “serverowner” group.
True is the user belongs in the admin group directly or indirectly, false otherwise.
v2.40 | Rewrite. |
Overwrite garry’s IsSuperAdmin function to check for membership in superadmin group. This is so if group “serverowner” inherits from superadmin, this function will still return true when checking on a member belonging to the “serverowner” group.
True is the user belongs in the superadmin group directly or indirectly, false otherwise.
v2.40 | Rewrite. |
This function is similar to IsUserGroup(), but this one checks the UCL group chain as well. For example, if a user is in group “superadmin” which inherits from “admin”, this function will return true if you check the user against “admin”, where IsUserGroup() wouldn’t.
group | The group you want to check a player’s membership in. |
A boolean stating whether they have membership in the group or not.
v2.40 | Initial. |
This function is used to see if a user has access to a command.
function ucl.query( ply, access, hide )
This function is used to see if a specified group is inheriting from another
function ucl.groupInheritsFrom( group )
This function returns a tree-like structure representing the group inheritance architecture.
function ucl.getInheritanceTree()
Gets what a group is allowed to target in the UCL.
function ucl.getGroupCanTarget( group )