by Malte Reißig.
Hi i!
- Add the "core_webservice_get_site_info" function call to your "ExternalService"-Configuration
- Ask the "core_webservice_get_site_info" with a wstoken and the response will get you the 'userid' (among other infos) related to this wstoken.
And depending on the function and your "webservice authenticaton method" configuration:
- Double check if the "User" (related to the "wstoken" you're talking to the moodle-webservice with) has the necessary "Capability" or "Role" active (set to 'true') to actually call the function.
Cheers & Have Fun!