From: Sam Reed Date: Mon, 18 Jul 2011 21:26:33 +0000 (+0000) Subject: * (bug 29938) list=users&usprop=rights shows rights the user doesn't have X-Git-Tag: 1.31.0-rc.0~28764 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=d510cdd91d1cbd83a9195a110fbc90d1186e4c1c;p=lhc%2Fweb%2Fwiklou.git * (bug 29938) list=users&usprop=rights shows rights the user doesn't have --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index acf83bad50..57cf5b3ba7 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -198,6 +198,7 @@ production. * Correct the documentation of srprop properties * (bug 28817) Add reference help page link to API Modules * (bug 29935) Improve formatting of examples in ApiParamInfo +* (bug 29938) list=users&usprop=rights shows rights the user doesn't have === Languages updated in 1.19 === diff --git a/includes/api/ApiQueryAllUsers.php b/includes/api/ApiQueryAllUsers.php index 22f56268e9..6b8c2ee28a 100644 --- a/includes/api/ApiQueryAllUsers.php +++ b/includes/api/ApiQueryAllUsers.php @@ -248,7 +248,7 @@ class ApiQueryAllUsers extends ApiQueryBase { if ( $fld_rights ) { if ( !isset( $lastUserData['rights'] ) ) { - $lastUserData['rights'] = User::getGroupPermissions( User::getImplicitGroups() ); + $lastUserData['rights'] = User::getGroupPermissions( User::newFromName( $lastUser )->getAutomaticGroups() ); } if ( !is_null( $row->ug_group2 ) ) { $lastUserData['rights'] = array_unique( array_merge( $lastUserData['rights'], diff --git a/includes/api/ApiQueryUsers.php b/includes/api/ApiQueryUsers.php index bbe90f5847..4e7bb2cbd9 100644 --- a/includes/api/ApiQueryUsers.php +++ b/includes/api/ApiQueryUsers.php @@ -154,7 +154,7 @@ class ApiQueryUsers extends ApiQueryBase { if ( isset( $this->prop['rights'] ) ) { if ( !isset( $data[$name]['rights'] ) ) { - $data[$name]['rights'] = User::getGroupPermissions( User::getImplicitGroups() ); + $data[$name]['rights'] = User::getGroupPermissions( $user->getAutomaticGroups() ); } if ( !is_null( $row->ug_group ) ) {