mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-26635 Return a more explicit debuginfo message when the user can not access the web service function
This commit is contained in:
parent
9cfaebbd0e
commit
ccda013458
@ -26,6 +26,7 @@
|
||||
$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';
|
||||
$string['addcapabilitytousers'] = 'Check users capability';
|
||||
$string['addcapabilitytousersdescription'] = 'Users should have two capabilities - webservice:createtoken and a capability matching the protocols used, for example webservice/rest:use, webservice/soap:use. To achieve this, create a web services role with the appropriate capabilities allowed and assign it to the web services user as a system role.';
|
||||
|
@ -1310,7 +1310,7 @@ abstract class webservice_base_server extends webservice_server {
|
||||
}
|
||||
$rs->close();
|
||||
if (!$allowed) {
|
||||
throw new webservice_access_exception('Access to external function not allowed');
|
||||
throw new webservice_access_exception(get_string('accesstofunctionnotallowed', 'webservice', $this->functionname));
|
||||
}
|
||||
|
||||
// we have all we need now
|
||||
|
Loading…
x
Reference in New Issue
Block a user