Moodle system role creation

Moodle system role creation

by Ashley SATCHIVI -
Number of replies: 2


I need to create a plugin that automatically creates a role based on the Moodle admin role but with less capabilities for the purpose of a school internship. So far I have done several researches but I do not find concretely what I want.

I also tried to get inspired by the source code of Moodle.

 To add a new role, we will have to follow this path: Site Administration -> Users -> Define roles and choose "Add a new role" 

and the url is "localhost/mymoodle/admin/roles/define.php?action=add" but after choosing the role it inherits, the path is "localhost/mymoodle/admin/roles/define.php" and it comes with the capabilities of the model role.

It is almost not possible to create it automatically.


I don't really understand the source code inside. I really need your help.


Average of ratings: -
In reply to Ashley SATCHIVI

Re: Moodle system role creation

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Is the existing Manager role not suitable for your purposes then?
In reply to Mary Cooch

Re: Moodle system role creation

by Ashley SATCHIVI -
The goal is to create directors by company and for that, he must inherit the administrator role and I must remove some rights from him