API: Add text for Unknown error: "permissiondenied"

The api does not known a generic "permissiondenied" message.

Change-Id: I65822c9f58ce323352db759d46bf11d4ddab14bd
This commit is contained in:
umherirrender 2013-10-27 17:33:39 +01:00
parent 6a89fd9750
commit b3456b1e17
2 changed files with 4 additions and 4 deletions

View file

@ -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' ),

View file

@ -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' ),
) );
}