Remove LogEventsList::typeAction support for rights
Bug: T246412 Change-Id: I07fbaa8d9dfc10bc11bca3f8ea444b3bd393832f
This commit is contained in:
parent
7b0396a6ad
commit
b82b1cc61a
2 changed files with 5 additions and 11 deletions
|
|
@ -120,6 +120,10 @@ because of Phabricator reports.
|
|||
- APIQueryRevisionsTokens
|
||||
- APIQueryUsersTokens
|
||||
- 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
|
||||
in 1.35, has been removed. Use LBFactory::waitForReplication() instead.
|
||||
* The global variable $wgMemc, deprecated since 1.35, has been removed.
|
||||
|
|
|
|||
|
|
@ -506,24 +506,14 @@ class LogEventsList extends ContextSource {
|
|||
* @param stdClass $row
|
||||
* @param string|array $type
|
||||
* @param string|array $action
|
||||
* @param string $right (deprecated since 1.35)
|
||||
* @return bool
|
||||
*/
|
||||
public static function typeAction( $row, $type, $action, $right = '' ) {
|
||||
if ( $right !== '' ) {
|
||||
wfDeprecated( __METHOD__ . ' with a right specified', '1.35' );
|
||||
}
|
||||
public static function typeAction( $row, $type, $action ) {
|
||||
$match = is_array( $type ) ?
|
||||
in_array( $row->log_type, $type ) : $row->log_type == $type;
|
||||
if ( $match ) {
|
||||
$match = is_array( $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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue