Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-29825 better debug info when a ws client user misses a protocol c…

…apability
  • Loading branch information...
commit 729ca373885e021120ff35bc04781143763cf330 1 parent 3a81b37
@mouneyrac mouneyrac authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  lang/en/webservice.php
  2. +1 −1  webservice/lib.php
View
2  lang/en/webservice.php
@@ -24,7 +24,6 @@
*/
$string['accessexception'] = 'Access control exception';
-$string['accessnotallowed'] = 'Access to web service not allowed';
$string['actwebserviceshhdr'] = 'Active web service protocols';
$string['accesstofunctionnotallowed'] = 'Access to the function {$a}() is not allowed. Please check if a service containing the function is enabled. In the service settings: if the service is restricted check that the user is listed. Still in the service settings check for IP restriction or if the service requires a capability.';
$string['addaservice'] = 'Add service';
@@ -130,6 +129,7 @@
$string['potusersmatching'] = 'Not authorised users matching';
$string['print'] = 'Print all';
$string['protocol'] = 'Protocol';
+$string['protocolnotallowed'] = 'You are not allowed to use the {$a} protocol (missing capability: webservice/{$a}:use)';
$string['removefunction'] = 'Remove';
$string['removefunctionconfirm'] = 'Do you really want to remove function "{$a->function}" from service "{$a->service}"?';
$string['requireauthentication'] = 'This method requires authentication with xxx permission.';
View
2  webservice/lib.php
@@ -659,7 +659,7 @@ protected function authenticate_user() {
$this->userid = $user->id;
if ($this->authmethod != WEBSERVICE_AUTHMETHOD_SESSION_TOKEN && !has_capability("webservice/$this->wsname:use", $this->restricted_context)) {
- throw new webservice_access_exception(get_string('accessnotallowed', 'webservice'));
+ throw new webservice_access_exception(get_string('protocolnotallowed', 'webservice', $this->wsname));
}
external_api::set_context_restriction($this->restricted_context);
Please sign in to comment.
Something went wrong with that request. Please try again.