Skip to content

corvus-albus/moodle-local_wsgetroles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Get roles in moodle via web servide (rest api)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages