Page MenuHomePhabricator

Add hook before changing of userrights
Open, LowPublic

Description

Author: trollingstone

Description:
I can do it with following code in includes/specials/SpecialUserrights.php:

    global $wgUserrightsProtectedUsers;
    if( in_array( User::getCanonicalName( $this->mTarget ), $wgUserrightsProtectedUsers ) ) {
        $out = $this->getOutput();
        $out->setPageTitle( 'Forbidden' );
        $out->addHTML('In the name of Holy Federal Security Service, you can't modify groups of this user.');
        return true;
}

More cleanly do it with hook.

good first task: The hook now exists but can't be aborted. Add that functionality in order to fully address the original request.

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:15 AM
bzimport set Reference to bz47338.
bzimport added a subscriber: Unknown Object (MLST).

Change 329727 had a related patch set uploaded (by MtDu):
Add a 'ChangeUserGroups' hook in Special:Userrights

https://gerrit.wikimedia.org/r/329727

MtDu claimed this task.
MtDu subscribed.

Patch has been merged here. https://gerrit.wikimedia.org/r/#/c/329727/ Hence closing as resolved.
Thanks!

Change 329727 merged by jenkins-bot:
Add a 'ChangeUserGroups' hook in Special:Userrights

https://gerrit.wikimedia.org/r/329727

TTO subscribed.

This isn't done yet... we still need to add the possibility to allow the hook to abort the process if it wants to. I'll do this after the user rights expiration stuff is sorted out

matej_suchanek removed a project: Patch-For-Review.
matej_suchanek updated the task description. (Show Details)
matej_suchanek removed a subscriber: wikibugs-l-list.

My exams end on May 12, Can take a look then. Feel free to if you're up to it. @TTO

Change 542662 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Allow aborting changing userrights using ChangeUserGroups hook

https://gerrit.wikimedia.org/r/542662

Aklapper added a subscriber: DannyS712.

Removing task assignee due to inactivity, as this open task has been assigned for more than two years. See the email sent to the task assignee on February 06th 2022 (and T295729).

Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome.

If this task has been resolved in the meantime, or should not be worked on ("declined"), please update its task status via "Add Action… 🡒 Change Status".

Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator.