Remove LogEventsList::typeAction support for rights

Bug: T246412
Change-Id: I07fbaa8d9dfc10bc11bca3f8ea444b3bd393832f
This commit is contained in:
DannyS712 2020-09-10 00:25:44 +00:00
parent 7b0396a6ad
commit b82b1cc61a
2 changed files with 5 additions and 11 deletions

View file

@ -120,6 +120,10 @@ because of Phabricator reports.
- APIQueryRevisionsTokens - APIQueryRevisionsTokens
- APIQueryUsersTokens - APIQueryUsersTokens
- ApiTokensGetTokenTypes - ApiTokensGetTokenTypes
* LogEventsList::typeAction previously accepted an optional right parameter,
and checked if the context user ($wgUser) had that right. Passing a right
was hard deprecated in 1.35, and support for passing a right has now been
removed.
* The global function `wfWaitForSlaves`, deprecated in 1.27 and hard-deprecated * The global function `wfWaitForSlaves`, deprecated in 1.27 and hard-deprecated
in 1.35, has been removed. Use LBFactory::waitForReplication() instead. in 1.35, has been removed. Use LBFactory::waitForReplication() instead.
* The global variable $wgMemc, deprecated since 1.35, has been removed. * The global variable $wgMemc, deprecated since 1.35, has been removed.

View file

@ -506,24 +506,14 @@ class LogEventsList extends ContextSource {
* @param stdClass $row * @param stdClass $row
* @param string|array $type * @param string|array $type
* @param string|array $action * @param string|array $action
* @param string $right (deprecated since 1.35)
* @return bool * @return bool
*/ */
public static function typeAction( $row, $type, $action, $right = '' ) { public static function typeAction( $row, $type, $action ) {
if ( $right !== '' ) {
wfDeprecated( __METHOD__ . ' with a right specified', '1.35' );
}
$match = is_array( $type ) ? $match = is_array( $type ) ?
in_array( $row->log_type, $type ) : $row->log_type == $type; in_array( $row->log_type, $type ) : $row->log_type == $type;
if ( $match ) { if ( $match ) {
$match = is_array( $action ) ? $match = is_array( $action ) ?
in_array( $row->log_action, $action ) : $row->log_action == $action; in_array( $row->log_action, $action ) : $row->log_action == $action;
if ( $match && $right ) {
global $wgUser;
$match = MediaWikiServices::getInstance()
->getPermissionManager()
->userHasRight( $wgUser, $right );
}
} }
return $match; return $match;