Let abusefilter-modify users see history of hidden filters

d0439337 (I9e15326c) made abusefilter-view-private required
even for users with abusefilter-modify that can see and
change private filters.

Bug: T143365
Change-Id: I401effc5f1e429b5ec12c7f48dcc00ada74eafb6
This commit is contained in:
Platonides 2016-08-18 23:26:48 +02:00 committed by Kunal Mehta
parent 66afef7840
commit bb277d437e
2 changed files with 6 additions and 4 deletions

View file

@ -100,7 +100,7 @@ class AbuseFilterViewDiff extends AbuseFilterView {
$this->mFilter = $this->mParams[1];
if ( AbuseFilter::filterHidden( $this->mFilter )
&& !$this->getUser()->isAllowed( 'abusefilter-view-private' )
&& !$this->getUser()->isAllowedAny( array( 'abusefilter-modify', 'abusefilter-view-private' ) )
) {
$this->getOutput()->addWikiMsg( 'abusefilter-history-error-hidden' );
return false;

View file

@ -16,9 +16,9 @@ class AbuseFilterViewHistory extends AbuseFilterView {
$out->setPageTitle( $this->msg( 'abusefilter-filter-log' ) );
}
# Check perms
# Check perms. abusefilter-modify is a superset of abusefilter-view-private
if ( $filter && AbuseFilter::filterHidden( $filter )
&& !$this->getUser()->isAllowed( 'abusefilter-view-private' )
&& !$this->getUser()->isAllowedAny( array( 'abusefilter-modify', 'abusefilter-view-private' ) )
) {
$out->addWikiMsg( 'abusefilter-history-error-hidden' );
return;
@ -234,7 +234,9 @@ class AbuseFilterHistoryPager extends TablePager {
$info['conds']['afh_filter'] = $this->mFilter;
}
if ( !$this->getUser()->isAllowed( 'abusefilter-view-private' ) ) {
if ( !$this->getUser()->isAllowedAny(
array( 'abusefilter-modify', 'abusefilter-view-private' ) )
) {
// Hide data the user can't see.
$info['conds']['af_hidden'] = 0;
}