Ulysses

General => Developers Corner => Topic started by: chudders1231 on December 30, 2016, 10:19:43 AM

Title: Creating Permissions
Post by: chudders1231 on December 30, 2016, 10:19:43 AM
Hey,
I am fairly new to LUA, especially in GMOD and im also new to ULX's functions so i was wondering how i can create permissions in ULX so that the user's of my script can assign it to groups.

Thanks!
Title: Re: Creating Permissions
Post by: Bytewave on December 30, 2016, 07:40:50 PM
You can create permissions with ULib.ucl.registerAccess, seen here (https://github.com/TeamUlysses/ulx/blob/b7adea4fed9d3b582dabc3db5d198cbda899b2a7/lua/ulx/modules/sh/chat.lua#L16).
You can validate that users have permissions with ULib.ucl.query, seen here (https://github.com/TeamUlysses/ulx/blob/b7adea4fed9d3b582dabc3db5d198cbda899b2a7/lua/ulx/modules/sh/chat.lua#L31).

That should be about it.
Title: Re: Creating Permissions
Post by: Megiddo on January 01, 2017, 10:54:55 AM
Or, you can find the documentation for that function here -- http://ulyssesmod.net/docs/files/lua/ulib/server/ucl-lua.html#ucl.registerAccess :)
Title: Re: Creating Permissions
Post by: Bytewave on January 01, 2017, 11:48:55 AM
Or, you can find the documentation for that function here -- http://ulyssesmod.net/docs/files/lua/ulib/server/ucl-lua.html#ucl.registerAccess :)
Oh, right, I forgot there was documentation. :P