mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-09-24 10:48:17 +00:00
API: Add text for Unknown error: "permissiondenied"
The api does not known a generic "permissiondenied" message. Change-Id: I65822c9f58ce323352db759d46bf11d4ddab14bd
This commit is contained in:
parent
6a89fd9750
commit
b3456b1e17
|
@ -7,7 +7,7 @@ class ApiAbuseFilterCheckMatch extends ApiBase {
|
|||
|
||||
// "Anti-DoS"
|
||||
if ( !$this->getUser()->isAllowed( 'abusefilter-modify' ) ) {
|
||||
$this->dieUsageMsg( 'permissiondenied' );
|
||||
$this->dieUsage( 'You don\'t have permission to test abuse filters', 'permissiondenied' );
|
||||
}
|
||||
|
||||
if ( $params['vars'] ) {
|
||||
|
@ -93,7 +93,7 @@ class ApiAbuseFilterCheckMatch extends ApiBase {
|
|||
return array_merge( parent::getPossibleErrors(),
|
||||
$this->getRequireOnlyOneParameterErrorMessages( array( 'vars', 'rcid', 'logid' ) ),
|
||||
array(
|
||||
array( 'permissiondenied' ),
|
||||
array( 'code' => 'permissiondenied', 'info' => 'You don\'t have permission to test abuse filters' ),
|
||||
array( 'nosuchrcid' ),
|
||||
array( 'code' => 'nosuchlogid', 'info' => 'There is no abuselog entry with the id given' ),
|
||||
array( 'code' => 'badsyntax', 'info' => 'The filter has invalid syntax' ),
|
||||
|
|
|
@ -5,7 +5,7 @@ class ApiAbuseFilterCheckSyntax extends ApiBase {
|
|||
public function execute() {
|
||||
// "Anti-DoS"
|
||||
if ( !$this->getUser()->isAllowed( 'abusefilter-modify' ) ) {
|
||||
$this->dieUsageMsg( 'permissiondenied' );
|
||||
$this->dieUsage( 'You don\'t have permission to check syntax of abuse filters', 'permissiondenied' );
|
||||
}
|
||||
|
||||
$params = $this->extractRequestParams();
|
||||
|
@ -48,7 +48,7 @@ class ApiAbuseFilterCheckSyntax extends ApiBase {
|
|||
|
||||
public function getPossibleErrors() {
|
||||
return array_merge( parent::getPossibleErrors(), array(
|
||||
array( 'permissiondenied' ),
|
||||
array( 'code' => 'permissiondenied', 'info' => 'You don\'t have permission to check syntax of abuse filters' ),
|
||||
) );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue