Author Topic: Lower Rank Can Give Self A Higher Rank  (Read 5165 times)

0 Members and 1 Guest are viewing this topic.

Offline DendeSon

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
  • No.
    • Gentlemen Gaming
Lower Rank Can Give Self A Higher Rank
« on: October 28, 2013, 06:25:21 PM »
Hello. I am running a TTT server and need help with ranking. The only groups that i am concerned with are 'S.Admin' and 'Staff'. Is there a way to allow 'S.Admin' to change peoples ranks but restrict them from being able to change their own or someones rank to 'Staff' ( Basically a higher group)?

The perm that is being focused on is the 'adduser' and 'removeuser'.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Lower Rank Can Give Self A Higher Rank
« Reply #1 on: October 28, 2013, 06:51:52 PM »
See our FAQs and articles regarding can_target.
They will get you started.

"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline DendeSon

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
  • No.
    • Gentlemen Gaming
Re: Lower Rank Can Give Self A Higher Rank
« Reply #2 on: October 29, 2013, 03:49:38 PM »
I understand how can_target works and I do have it setup for S.Admin and Staff. S.Admin can_target !%staff and Staff can_target *. I still cannot limit the power of the S.Admin giving themselves Staff (the higher rank).

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Lower Rank Can Give Self A Higher Rank
« Reply #3 on: October 29, 2013, 07:51:38 PM »
Ok, to be perfectly honest, I've never actually had to do what your trying.
Your server may explode. I personally don't recommend mis-use of remove/add user. It's superadmin for a reason by default, even with our uber awesome restriction system.
BUT, from what I see here - http://forums.ulyssesmod.net/index.php/topic,4872.msg20767.html#msg20767
(Not a faq, but knew there were 'how to limit' discussions somewhere, you MAY be able to limit your s.admin group with something like.
Code: [Select]
ulx groupallow s.admin "ulx adduser" "* !%staff"Same for ulx removeuser.
If you have more than one higher group than staff, use commas.
Code: [Select]
ulx groupallow s.admin "ulx adduser" "* !%staff,!%<higher_group2>,!%<higher_group3>"
You'll have to figure out on your own how to prevent your s.admin from adjusting staff level members. Might be *,!%staff in that first parameter.

Now, all the above being said, we really, and I mean REALLY, don't advise giving anyone adduser/remove user access in this way even if it works.
Those commands are meant for root/superuser only. It's why Gmod created it that way.
I understand the whole convenience thing, but, really, trust should be seriously earned.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Lower Rank Can Give Self A Higher Rank
« Reply #4 on: October 30, 2013, 06:43:16 PM »
That's a neat idea JamminR! But it unfortunately won't work -- the second argument to ulx adduser is a string, we have no special type for groups. Someone could specify what groups they're allowed to add a user to explicitly though, it would look like the following:

Code: [Select]
ulx groupallow sadmin "ulx adduser" "* operator,moderator,blah"
Experiencing God's grace one day at a time.

Offline DendeSon

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
  • No.
    • Gentlemen Gaming
Re: Lower Rank Can Give Self A Higher Rank
« Reply #5 on: December 15, 2013, 09:32:52 PM »
Sorry this is a bit late but where exactly would i put this line of code into?

Offline Cobalt

  • Full Member
  • ***
  • Posts: 216
  • Karma: 44
  • http://steamcommunity.com/id/__yvl/
Re: Lower Rank Can Give Self A Higher Rank
« Reply #6 on: December 15, 2013, 09:41:21 PM »
Sorry this is a bit late but where exactly would i put this line of code into?
It's a console command.

Offline DendeSon

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
  • No.
    • Gentlemen Gaming
Re: Lower Rank Can Give Self A Higher Rank
« Reply #7 on: December 16, 2013, 05:41:22 PM »
After typing this into console my "superadmin" rank could not change the group of anyone. I only needed them to be able to give the group "member".

 Here is what I typed into console:


Code: [Select]
ulx groupallow superadmin "ulx adduser" "* member"

Offline DendeSon

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
  • No.
    • Gentlemen Gaming
Re: Lower Rank Can Give Self A Higher Rank
« Reply #8 on: February 01, 2014, 08:32:59 PM »
You guys think you could possibly think about adding this into a future update? I could never figure out how to restrict 'superadmin' from adding themselves or others to 'staff'.

Offline Cobalt

  • Full Member
  • ***
  • Posts: 216
  • Karma: 44
  • http://steamcommunity.com/id/__yvl/
Re: Lower Rank Can Give Self A Higher Rank
« Reply #9 on: February 01, 2014, 08:47:55 PM »
If you don't trust superadmins with managing groups they shouldn't be superadmins in the first place.

Offline DendeSon

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
  • No.
    • Gentlemen Gaming
Re: Lower Rank Can Give Self A Higher Rank
« Reply #10 on: February 01, 2014, 08:52:40 PM »
If you don't trust superadmins with managing groups they shouldn't be superadmins in the first place.

Not what I am looking for but thanks anyways. Still curious about my previous post.

You guys think you could possibly think about adding this into a future update? I could never figure out how to restrict 'superadmin' from adding themselves or others to 'staff'.

Offline syn.

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 6
  • Lua Padawan
    • SynGaming
Re: Lower Rank Can Give Self A Higher Rank
« Reply #11 on: February 01, 2014, 09:34:16 PM »
... Just whitelist certain the ranks you want them to be able to add people to or themselves to. Go on the set permissions on the ulx xgui and then click restrict groups then on the whitelist type in the groups you want them to be able to access or become.

Example: http://gyazo.com/07d2f8ece11483bc579f630390362893
headadmin can addusers or addids to the groups/ranks in the whitelist. But headadmin can't addusers/ids to groups/ranks that aren't in the whitelist. Might be a pain but everything comes with a price.
« Last Edit: February 01, 2014, 09:41:40 PM by syn. »
Lua Student

"The more you understand, the crazier you get."

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given