Page MenuHomePhabricator

Add a hook, which is triggered when adding user to restricted group with private conditions
Closed, ResolvedPublic

Description

For T414913 we'll need a hook that extensions can handle and then perform logging. This hook should be triggered when performer tries to add another user to a restricted group depending on a private condition.

Proposed hook signature:

function onReadPrivateUserRequirementsCondition( UserIdentity $performer, UserIdentity $target, array $conditions ) { }

This hook represents an action of revealing the values of private conditions through failure or success of Special:UserRights (or API).

Acceptance criteria

  • UserGroupAssignmentService triggers the hook if any of the changed groups involves a private condition
  • SpecialUserRights triggers the hook if validation fails and at least one of the changed groups involve a private condition

Event Timeline

Change #1233182 had a related patch set uploaded (by Mszwarc; author: Mszwarc):

[mediawiki/core@master] Support listing private conditions for a given group

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

Change #1233183 had a related patch set uploaded (by Mszwarc; author: Mszwarc):

[mediawiki/core@master] Add a hook for revealing values of private group conditions

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

mszwarc renamed this task from Add a hook, which is triggered when adding user to restricted group is unsuccessful due to private conditions to Add a hook, which is triggered when adding user to restricted group with private conditions.Jan 27 2026, 10:37 AM

Change #1233182 merged by jenkins-bot:

[mediawiki/core@master] Support listing private conditions for a given group

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

Change #1233183 merged by jenkins-bot:

[mediawiki/core@master] Add a hook for revealing values of private group conditions

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