Author Topic: Toolallow/deny  (Read 3486 times)

0 Members and 1 Guest are viewing this topic.

Offline Oth

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Toolallow/deny
« on: May 22, 2007, 10:21:52 AM »
First of all, I'd like to thank all you ULX dev's for making an Admin's job alot easier!

I run a small 8 people build server, but I've been rather restricted in what Stools and such to add, due to potential abuse.
I thought I struck gold when i found out about Toolallow/deny.

To test it out, I downloaded a Particle Maker Stool, and did ULX tooldeny "Particle Maker"

Worked like a charm. Couldn't select the tool.

Then I tried to do ULX toolallowuser Oth "Particle Maker" (Oth being me, a superadmin)
It Echoes in the console that I've been allowed to use the Stool, but I can't select it.
Even after using just Toolallow instead of Toolallowuser, I can't select the tool anymore! I have no idea how to undo this, as the command seems broken.
I have no idea where the allow/deny information is stored, so I can't remove it manually either...

If anyone could tell me how to get the commands working, or where the relevant information is stored, I'd be very thankfull. (has to be somewhere, it was carried over a server restart)

Thanks eitherway.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Toolallow/deny
« Reply #1 on: May 22, 2007, 11:58:25 AM »
Oth,
 toolallow/deny is global, and I believe that it would be over user level access.
That is, if global = no, then all users = no, even if toolallowuser = yes
I'm on my laptop right now (my main machine is down) so I don't have all the code quickly handy.
I'll download and see if I can confirm this.
Megiddo or spbogie may come onboard and answer with more information. They have more experience with the deep inner workings of the code than I. :)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Toolallow/deny
« Reply #2 on: May 22, 2007, 12:20:30 PM »
Code: [Select]
local function tool( ply, tr, toolmode )
if (gdeny[ toolmode ] and not ply:IsAdmin()) or (ply.deny and ply.deny[ toolmode ]) then
ULib.tsay( ply, "This toolmode has been disabled." )
return false
end
end

That code is called wnenever someone attempts to select a tool.
gdeny is the table that contains the tools added using tooldeny.
I'm not sure why its not working.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Oth

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: Toolallow/deny
« Reply #3 on: May 23, 2007, 05:41:09 AM »
I'm guessing I've got an add-on which is stopping the commands from functioning properly... I'll try to see if I can find whats causing this.
But if i'm reading this right, admin's should be exempt from tooldeny? So even without toolallow, I should be able to use it.

Thanks for your help though.

edit: I need to learn to read properly :P
« Last Edit: May 23, 2007, 05:44:33 AM by Oth »

Offline spbogie

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: 41
Re: Toolallow/deny
« Reply #4 on: May 23, 2007, 01:02:17 PM »
JamminR is correct. The current implementation only stores the tools which are denied. When you allow a toolmode it just removes it from the appropriate deny table (global or user). There is no way, currently, to deny globaly and then whitelist certain users.
I have not failed. I've just found 10,000 ways that won't work. - Thomas A. Edison
I reject your reality and substitute my own. - Adam Savage

Offline Oth

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: Toolallow/deny
« Reply #5 on: May 26, 2007, 07:18:09 AM »
Well, that certainly cleares things up for me, thanks a bunch!

If any of you folks wanna enjoy a bit of spacebuilding on a nicely moderated server, drop by once a while.
The name begins with Oth, so it shouldn't be too hard to find.

Cheers.