ULX

Author Topic: Denying toolmodes by usergroup.  (Read 2983 times)

0 Members and 1 Guest are viewing this topic.

Offline sparky2002b

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
  • CloudNine Clan Administrator
Denying toolmodes by usergroup.
« on: August 21, 2008, 01:36:47 PM »
Hi, all!

I wrote a donation system on my server (208.122.52.131:27016) which is tied via SQL to my website (c9clan.com). When a user donates via PayPal, IPN notifies the forum, and sets them as a donor, which is then propagated to the server via SQL, and ends up adding the user to userlist automatically. In short, when they donate, they're auto-added to the "donors" group in Garry's Mod's settings.txt and ULib.

I've already given them certain ULX command access via ULib's groups, however, I'd like to allow them use to certain donor-only toolmodes (I've written a few STools). I see you can globally deny with tooldeny and deny a single user with tooldenyuser - is there a way I can deny toolmodes to a usergroup, or, preferably, allow a usergroup to use a tool that's been globally denied?

Thanks.
« Last Edit: August 21, 2008, 01:41:45 PM by sparky2002b »
CloudNine Clan Server - 68.64.33.152:27019 - http://c9gc.com

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Denying toolmodes by usergroup.
« Reply #1 on: August 21, 2008, 04:34:23 PM »
Not currently, but this is a much requested feature that we're working on.
Experiencing God's grace one day at a time.

Offline sparky2002b

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
  • CloudNine Clan Administrator
Re: Denying toolmodes by usergroup.
« Reply #2 on: August 21, 2008, 04:37:56 PM »
I suppose I could do something similar to:
foreach(userid in someusergroup) conCommand.Run("ulx toolallow sometoolmode ".userid)

(Obviously that's not an LUA block, just an example)
CloudNine Clan Server - 68.64.33.152:27019 - http://c9gc.com

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Denying toolmodes by usergroup.
« Reply #3 on: August 21, 2008, 07:13:00 PM »
Sparky, take a good search of the forums. As megiddo said, this is a much requested feature, and I'm pretty sure I've seen code discussion somewhere around here.
Sorry, right now I can't even think of search terms. It's been a long day, and even longer week.(Heck, month for that matter)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline sparky2002b

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
  • CloudNine Clan Administrator
Re: Denying toolmodes by usergroup.
« Reply #4 on: August 21, 2008, 07:21:02 PM »
I found this thread: http://forums.ulyssesmod.net/index.php/topic,3414.0.html

Assuming I update to the latest SVN, I could in theory do:

Code: [Select]
server.cfg
ulx tooldeny someTool

Code: [Select]
groups.txt
"someGroup"
{
   "deny"   
   {
   }
   "allow"   
   {
    "ulx tooldenyoverride"
   }
   "inherit_from"   
   {
   }
}

Am I correct?
CloudNine Clan Server - 68.64.33.152:27019 - http://c9gc.com

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Denying toolmodes by usergroup.
« Reply #5 on: August 21, 2008, 08:14:16 PM »
That's right. :)
Experiencing God's grace one day at a time.