General > Developers Corner

Allows with Inheritance

(1/2) > >>

iViscosity:
I was wondering, how are permissions given through inheritance? Reading through my groups.txt, I don't see every command in "superadmin", for example, and only the onces that appear to be manually given. Therefore my question is, how can I get everything that group is allowed to do even through inheritance and not just what it is explicitly allowed to do (through ULib.ucl.groups[ group ].allow)?

BlueNova:
Looking through documentation I didn't really see anything but you could do it the old fashioned (but tedious way)

Or something I've considered doing in the past. Just create a lua file that's purely a massive table of all ULX perms and then just create a function to loop through them and search if the group is allowed and do what you will with them. Considered doing that before. You may be more successful with it than me. One time on a server I was setting up I tried to do it on my "super" but not super admins and root users to differentiate permissions and sometimes got an overload.


TL;DR - I don't see anything in documentation but with elbow grease you could do what you're asking just may take a bit of work.

JamminR:
ULib has lots of magic, but the command names are mostly here.
http://ulyssesmod.net/docs/files/lua/ulib/shared/sh_ucl-lua.html
You can dig into the code behind those functions more if you wish within the TeamUlysses ULib github repo.

Additionally, ULib hooks(basically overwriting) the IsAdmin, IsSuperAdmin and IsUserGroup default checks for non-ULib aimed addons, then adds our own magic using shared UCL commands for those meant for ULib/ULX.
Another popular gamemode's admin system does this too, hence why ULX gets lots of conflict reports which we explain are difficult to fix due to conflicting addons.

iViscosity:
So I've been doing some looking and I think the easiest way for me to do this is use getInheritanceTree() and then taking all the explicit allows from the groups under it and storing it in a table.

JamminR:
No.
If you need to see if anyone can do anything in ULib, ULX, or any permission stored in the groups and user tables, query them. It takes into count the possibility they may have been explicitly denied (or allowed) in their user table, which, your idea won't fully check.

Navigation

[0] Message Index

[#] Next page

Go to full version