mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 06:03:49 +00:00
Don't show link to testing interface when the user cannot test filters
Clicking on this link only shows an error message unless the user can edit filters. Change-Id: Id912731e98f0f37b999d4a8e7ab190cd938825aa
This commit is contained in:
parent
3721431986
commit
0dca928f58
|
@ -472,25 +472,27 @@ class AbuseFilterViewEdit extends AbuseFilterView {
|
|||
$fields['abusefilter-edit-flags'] = $flags;
|
||||
$tools = '';
|
||||
|
||||
if ( $filter != 'new' && $user->isAllowed( 'abusefilter-revert' ) ) {
|
||||
$tools .= Xml::tags(
|
||||
'p', null,
|
||||
$this->linkRenderer->makeLink(
|
||||
$this->getTitle( 'revert/' . $filter ),
|
||||
$this->msg( 'abusefilter-edit-revert' )->text()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ( $filter != 'new' ) {
|
||||
// Test link
|
||||
$tools .= Xml::tags(
|
||||
'p', null,
|
||||
$this->linkRenderer->makeLink(
|
||||
$this->getTitle( "test/$filter" ),
|
||||
new HtmlArmor( $this->msg( 'abusefilter-edit-test-link' )->parse() )
|
||||
)
|
||||
);
|
||||
if ( $user->isAllowed( 'abusefilter-revert' ) ) {
|
||||
$tools .= Xml::tags(
|
||||
'p', null,
|
||||
$this->linkRenderer->makeLink(
|
||||
$this->getTitle( "revert/$filter" ),
|
||||
$this->msg( 'abusefilter-edit-revert' )->text()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ( $user->isAllowed( 'abusefilter-modify' ) ) {
|
||||
// Test link
|
||||
$tools .= Xml::tags(
|
||||
'p', null,
|
||||
$this->linkRenderer->makeLink(
|
||||
$this->getTitle( "test/$filter" ),
|
||||
new HtmlArmor( $this->msg( 'abusefilter-edit-test-link' )->parse() )
|
||||
)
|
||||
);
|
||||
}
|
||||
// Last modification details
|
||||
$userLink =
|
||||
Linker::userLink( $row->af_user, $row->af_user_text ) .
|
||||
|
|
Loading…
Reference in a new issue