Skip to content

Commit

Permalink
MDL-31209 web service error message: Indication about the service not…
Browse files Browse the repository at this point in the history
… containg the web service function is confusing
  • Loading branch information
mouneyrac committed May 14, 2013
1 parent 1e374df commit ca11d39
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions webservice/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1633,10 +1633,17 @@ protected function load_function_info() {
if (!$allowed) {
throw new webservice_access_exception(
'Access to the function '.$this->functionname.'() 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.');
There could be multiple reasons for this:
1. The service linked to the user token does not contain the function.
2. The service is user-restricted and the user is not listed.
3. The service is IP-restricted and the user IP is not listed.
4. The service is time-restricted and the time has expired.
5. The token is time-restricted and the time has expired.
6. The service requires a specific capability which the user does not have.
7. The function is called with username/password (no user token is sent)
and none of the services has the function to allow the user.
These settings can be found in Administration > Site administration
> Plugins > Web services > External services and Manage tokens.');
}

// we have all we need now
Expand Down

0 comments on commit ca11d39

Please sign in to comment.