Last modified: 2011-07-18 21:29:18 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T31938, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29938 - list=users&usprop=rights shows rights the user doesn't have
list=users&usprop=rights shows rights the user doesn't have
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-18 07:35 UTC by Michael M.
Modified: 2011-07-18 21:29 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Michael M. 2011-07-18 07:35:58 UTC
Split from bug 29906: list=users&usprop=rights shows rights the user doesn't have

Steps to reproduce:
1. Look into [[Special:Log/newusers]] to get the name of a new user.
2. http://en.wikipedia.org/w/api.php?action=query&list=users&ususers=Futbol%20vic&usprop=rights

In this example we get rights shown like move and autoconfirmed which a new user definitely doesn't have. The groups are correct and I didn't find any edit to a semiprotected page by a new user though I can see autoconfirmed rights for all users in every project, so it seems like only the API shows nonsense.
Comment 1 Sam Reed (reedy) 2011-07-18 09:23:28 UTC
This may have already been fixed in trunk quite a while back
Comment 2 Sam Reed (reedy) 2011-07-18 15:53:47 UTC
					if ( !isset( $data[$name]['rights'] ) ) {
						$data[$name]['rights'] = User::getGroupPermissions( User::getImplicitGroups() );
					}

On my dev wiki... User::getImplicitGroups() returns

array
  0 => string '*' (length=1)
  1 => string 'user' (length=4)
  2 => string 'autoconfirmed' (length=13)

And the same on enwiki


reedy@fenari:/home/wikipedia/common/php-1.17/maintenance$ php eval.php --wiki=enwiki
> var_dump( User::getImplicitGroups() );
array(3) {
  [0]=>
  string(1) "*"
  [1]=>
  string(4) "user"
  [2]=>
  string(13) "autoconfirmed"
}

>


Hell, it's hardcoded in DefaultSettings

/**
 * Implicit groups, aren't shown on Special:Listusers or somewhere else
 */
$wgImplicitGroups = array( '*', 'user', 'autoconfirmed' );


> $user = User::newFromName( 'Reedy' );

> var_dump( $user->getEffectiveGroups() );
array(5) {
  [0]=>
  string(11) "abusefilter"
  [1]=>
  string(5) "sysop"
  [2]=>
  string(1) "*"
  [3]=>
  string(4) "user"
  [4]=>
  string(13) "autoconfirmed"
}

> $user = User::newFromName( 'Futbol_vic' );

> var_dump( $user->getEffectiveGroups() );
array(2) {
  [0]=>
  string(1) "*"
  [1]=>
  string(4) "user"
}

>
Comment 3 Mark A. Hershberger 2011-07-18 20:41:22 UTC
(In reply to comment #2)
> Hell, it's hardcoded in DefaultSettings

So, "INVALID"?
Comment 4 Sam Reed (reedy) 2011-07-18 20:42:31 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > Hell, it's hardcoded in DefaultSettings
> 
> So, "INVALID"?

No, it's still a bug, technically the API is calling the "wrong" function
Comment 5 Sam Reed (reedy) 2011-07-18 21:29:18 UTC
r92477

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links