mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-29825 better debug info when a ws client user misses a protocol capability
This commit is contained in:
parent
3a81b37617
commit
729ca37388
@ -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['potusers'] = 'Not authorised users';
|
||||
$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.';
|
||||
|
@ -659,7 +659,7 @@ abstract class webservice_server implements webservice_server_interface {
|
||||
$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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user