Page MenuHomePhabricator

action=userrights: give error when user is not allowed to change userrights
Open, LowPublic

Description

At the moment the action=userrights modules makes nothing, when the user is not allow to change any userrights or one of the specified userrights. It is better to get a api error in this case.

Thanks.

You can call UserrightsPage::userCanChangeRights to check if the user can change any userrights.


Version: 1.20.x
Severity: normal

Details

Reference
bz33732
TitleReferenceAuthorSource BranchDest Branch
ldap: escape cn values when searchingtoolforge-repos/gitlab-account-approval!13bd808work/bd808/escape-ldap-search-inputmain
Customize query in GitLab

Event Timeline

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

Currently, UserrightsPage (Special:UserRights) includes a userCanChangeRights function. A similar functionality is needed in the api. I suggest adding a function, either to User or UserGroupManager[1] to see if a user can change rights for a specified target user, to avoid publication. Since userCanChangeRights is used by SkinTemplate, SpecialContributions, and MediaWiki-extensions-CleanChanges I think it makes more sense to move it out of the special page file. Thoughts?

[1] Doesn't exist yet, see https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/545690/

DannyS712 removed a project: User-DannyS712.