Skip to content

Creating a role

To create a role:

  1. Navigate to Site administration > Users > Permissions > Define roles.

  2. Click on Add a new role.

  3. Select Authenticated user in the Use role or archetupe field:

  4. Click Continue.

  5. Fill in the following fields:

    • Short name and Custom full name.

    • Check the box for System in the Context types where this role may be assigned field:

  6. Grant the following permissions to the role at the bottom of the page:

    • Use REST protocol (webservice/rest:use)
    • View hidden courses (moodle/course:viewhiddencourses)
    • Update course settings (moodle/course:update)
    • View courses without participation (moodle/course:view)
    • Manage quiz settings overrides (mod/quiz:manageoverrides)
    • View quiz information (mod/quiz:view)
    • Manage quizzes (mod/quiz:manage)
  7. Click Create this role.

  8. Navigate to Site administration > Users > Permissions > Assign system roles.

  9. Choose the created role to assign by cliching on it, then add the user.

  10. Navigate to Site administration > Server > Web services > External services.

  11. Click Add at the bottom of the page.

  12. Fill in the Name field.

  13. Enable the Enabled. The remaining settings should be left as default.

  14. Click Add service:

  15. Click Add functions:

  16. Enter the core_course_get_contents in the Name field, then click on Add functions:

The result: