If a user has partial access to modify user rights, their partial access should
not be blocked because of a partial block.
Bug: T228534
Change-Id: I7479953f1ef99d437184e5cbbe06adedf5b7a47b
// Deny if the user is blocked and doesn't have the full 'userrights' permission.
// This matches what Special:UserRights does for the web UI.
if ( !$pUser->isAllowed( 'userrights' ) ) {
- // @TODO Should the user be blocked from changing user rights if they
- // are partially blocked?
$block = $pUser->getBlock();
- if ( $block ) {
+ if ( $block && $block->isSitewide() ) {
$this->dieBlocked( $block );
}
}
* allow them to change any user rights.
*/
if ( !$user->isAllowed( 'userrights' ) ) {
- // @TODO Should the user be blocked from changing user rights if they
- // are partially blocked?
$block = $user->getBlock();
- if ( $block ) {
- throw new UserBlockedError( $user->getBlock() );
+ if ( $block && $block->isSitewide() ) {
+ throw new UserBlockedError( $block );
}
}