Advertisement:

Author Topic: Best Answer  (Read 35973 times)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 65,977
    • Arantor on GitHub
Re: Best Answer
« Reply #140 on: August 21, 2016, 04:29:55 PM »
No, not necessarily. It just mandates that the primary group of the current user must be admin, global moderator or board moderator for that to work. Except the last part will never work because group 3 isn't a real group and only gets that setting under very specific circumstances.

Better solution, convert it to an allowedTo() call, maybe allowedTo moderate_board or admin_forum. Or a permission if the mod has one.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

Offline Mr. Jinx

  • Full Member
  • ***
  • Posts: 467
  • Gender: Male
    • Ziggo Forum Chelloo
Re: Best Answer
« Reply #141 on: August 22, 2016, 03:18:20 AM »
@phantomm: You probably wonder about the (0) part in $user_info['groups'][0]? That would return the primary group number of the member. I'm pretty sure it works nicely.

@Arantor: You are totally right, but this was just a quick change to fix something that wasn't working, without changing the code to much. The correct way would be to add a permission.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 65,977
    • Arantor on GitHub
Re: Best Answer
« Reply #142 on: August 22, 2016, 08:01:17 AM »
Except it might not because the primary group holding 3 for board moderator won't be as correct as often as thought.

Switching it out for moderate_board and admin_forum checks would be more reliable as other groups beyond 1, 2 and sometimes 3 could have relevant permissions.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.