Webservice get roles

Local plugins ::: local_wsgetroles
Maintained by corvus albus
This local plugin allows you to get moodles roles via REST API. There is no possibility to get role ids directly via rest api, though there are two core functions demanding for role id: core_role_assign_roles and core_role_unassign_roles.

Webservice get roles v0.9.0.1

Moodle 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9
Released: Kuwa kane, 30 Nyakanga 2020, 10:50 PM

Moodle WebService Get Roles (wsgetroles)

This local plugin allows you to get moodles roles via REST API. There is no possibility to get role ids directly via rest api, though there are two core functions demanding for role id: core_role_assign_roles and core_role_unassign_roles.

The function local_wsgetroles_get_roles is added to the rest api. You can give over lists of roleids, rolenames and/or roleshortnames and get the associated roleinformations (id, name, shortname, description, sortorder, archetype). If the given id, name, shortname has no corresponding role, roleinfomations will be "null" despite of the search entry. If you give over empty lists all roles will be returned.

Some example calls to the webservice function:

Configuration

No configuration needed, just install the plugin. Keep in mind to add the functions to the rest-service.

Usage

Use functions over Rest API.

Requirements

  • Moodle 3.3 or later

Installation

Copy the wsgetroles folder into your /local directory. Add the functions to your rest-service.

Author

Corvus Albus

Version information

Version build number
2020073000
Version release name
v0.9.0.1
Maturity
Stable version
MD5 Sum
1d89d4e2940523beb29f068f1c85d169
Supported software
Moodle 3.3, Moodle 3.4, Moodle 3.5, Moodle 3.6, Moodle 3.7, Moodle 3.8, Moodle 3.9

Version control information

Version control system (VCS)
GIT
VCS repository URL
VCS branch
master
VCS tag
v0.9.0.1

Default installation instructions for plugins of the type Local plugins

  1. Make sure you have all the required versions.
  2. Download and unpack the module.
  3. Place the folder in the "local" subdirectory.
  4. Visit http://yoursite.com/admin to finish the installation.