Skip to content

Commit

Permalink
MDL-26635 Return a more explicit debuginfo message when the user can …
Browse files Browse the repository at this point in the history
…not access the web service function
  • Loading branch information
mouneyrac committed Sep 21, 2011
1 parent 9cfaebb commit ccda013
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lang/en/webservice.php
Expand Up @@ -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.';
Expand Down
2 changes: 1 addition & 1 deletion webservice/lib.php
Expand Up @@ -1310,7 +1310,7 @@ protected function load_function_info() {
}
$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
Expand Down

0 comments on commit ccda013

Please sign in to comment.