diff options
author | Cindy Cicalese <cindom@gmail.com> | 2021-01-11 10:26:02 -0500 |
---|---|---|
committer | Cicalese <ccicalese@wikimedia.org> | 2021-02-23 14:31:14 +0000 |
commit | f6e1891c6f36a4fb4248512e1a21d65bb56138cf (patch) | |
tree | f63ff2a44bd7c774197ab37795c7fc7fe225d31c /includes/api/ApiQueryLogEvents.php | |
parent | 9cd7d35500b20e7c72903d2688fad9f7ed45af96 (diff) | |
download | mediawikicore-f6e1891c6f36a4fb4248512e1a21d65bb56138cf.tar.gz mediawikicore-f6e1891c6f36a4fb4248512e1a21d65bb56138cf.zip |
Use Authority and GroupPermissionLookup in Action API
Replaces calls directly to PermissionManager with calls to
the Authority object available from Context or the
GroupPermissionLookup service.
This patch does not address use of PermissionManager for
blocks.
Deprecations:
- ApiBase::checkUserRightsAny deprecated passing optional
User parameter
- ApiBase::checkTitleUserPermissions deprecated passing
LinkTarget as first parameter, takes PageIdentity instead
Bug: T271462
Bug: T271854
Change-Id: I5d7cac1c28a37e074750c46cda03283980a07fca
Diffstat (limited to 'includes/api/ApiQueryLogEvents.php')
-rw-r--r-- | includes/api/ApiQueryLogEvents.php | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index 65c7341a34c7..228d008e8221 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -223,12 +223,10 @@ class ApiQueryLogEvents extends ApiQueryBase { // Paranoia: avoid brute force searches (T19342) if ( $params['namespace'] !== null || $title !== null || $user !== null ) { - if ( !$this->getPermissionManager()->userHasRight( $this->getUser(), 'deletedhistory' ) ) { + if ( !$this->getAuthority()->isAllowed( 'deletedhistory' ) ) { $titleBits = LogPage::DELETED_ACTION; $userBits = LogPage::DELETED_USER; - } elseif ( !$this->getPermissionManager() - ->userHasAnyRight( $this->getUser(), 'suppressrevision', 'viewsuppressed' ) - ) { + } elseif ( !$this->getAuthority()->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) { $titleBits = LogPage::DELETED_ACTION | LogPage::DELETED_RESTRICTED; $userBits = LogPage::DELETED_USER | LogPage::DELETED_RESTRICTED; } else { |