Last modified: 2010-05-15 14:35:42 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 5282 - All logged in users can patrol edits if $wgOnlySysopsCanPatrol is unset/false
All logged in users can patrol edits if $wgOnlySysopsCanPatrol is unset/false
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-reviewed
Depends on:
  Show dependency treegraph
Reported: 2006-03-18 02:11 UTC by Alan Harder
Modified: 2010-05-15 14:35 UTC (History)
0 users

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

cvs patch to fix checking of patrol user right (5.48 KB, patch)
2006-03-18 02:13 UTC, Alan Harder

Description Alan Harder 2006-03-18 02:11:52 UTC
In 1.5.7 and current CVS it appears that $wgOnlySysopsCanPatrol is not defined
anywhere by default.  Also, the logic in the places that determine if the user
can patrol doesn't seem to work as intended:
  $wgUser->isAllowed('patrol') || !$wgOnlySysopsCanPatrol
This expression is always true if $wgOnlySysopsCanPatrol is unset/false.. thus
the remaining part of the "if" expression (not shown here) controls whether a
user can patrol, and isAllowed('patrol') has no effect.. end result: all logged
in users can patrol.
Also, one place in DifferenceEngine.php checks rollback right instead of patrol.

* MediaWiki: 1.5.7
* PHP: 4.4.2-1 (apache2handler)
* MySQL: 4.1.15-Debian_1-log

See attached patch for our fix (patch for CVS).. with the setting in
$wgGroupPermissions I didn't see the need for this global, so I removed it. 
Also didn't see a need for the extra isLoggedIn check each time.. just checking
isAllowed seems sufficient.
Without this global I didn't know what to put for the 3rd parameter to
MarkPatrolled and MarkPatrolledComplete hooks, so I changed those to false.
Comment 1 Alan Harder 2006-03-18 02:13:31 UTC
Created attachment 1452 [details]
cvs patch to fix checking of patrol user right
Comment 2 Rob Church 2006-03-18 16:07:34 UTC
Incorporated into CVS HEAD. Thanks for the patch.

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