X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=blobdiff_plain;f=includes%2Fapi%2FApiUserrights.php;h=3aaae70483c1968b5752aa20364508a7c8d98079;hb=eb8823743c281fe72446ae06809467fd2746f7f7;hp=8f3c404116d9a986c626963e9ac908e2e97c7b22;hpb=1e289e5424be2bfe62213dde90bea658b874f7e6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiUserrights.php b/includes/api/ApiUserrights.php index 8f3c404116..3aaae70483 100644 --- a/includes/api/ApiUserrights.php +++ b/includes/api/ApiUserrights.php @@ -51,7 +51,7 @@ class ApiUserrights extends ApiBase { // 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' ) ) { + if ( !$this->getPermissionManager()->userHasRight( $pUser, 'userrights' ) ) { $block = $pUser->getBlock(); if ( $block && $block->isSitewide() ) { $this->dieBlocked( $block ); @@ -112,6 +112,7 @@ class ApiUserrights extends ApiBase { $form = $this->getUserRightsPage(); $form->setContext( $this->getContext() ); + $r = []; $r['user'] = $user->getName(); $r['userid'] = $user->getId(); list( $r['added'], $r['removed'] ) = $form->doSaveUserGroups(