My task is to create some custom role with original permissions set. So I want to be sure my custom role could be saved and restored in my moodle instanse at any time. Surfing in moodle docs I found this tip http://docs.moodle.org/en/Roles_FAQ#How_do_I_copy_a_custom_role_from_one_Moodle_site_to_another But unfortunatelly this not works for me as I expect. What Im doing:
1. Create my custom new role "test_role"
2. Edit its permissions set (have allowed and prohibited a pair of permittions). Also set a course context type for it.
3. Create new empty course "test_backup_course" for role backuping
4. Manually enroll some test user to "test_backup_course" and set him my custom "test_role" role
5. Backup "test_backup_course" with all backup settings turned on ("Include enrolled users", "Include user role assignments" etc)
6. Delete "test_role" from my moodle instance to be sure that my custom role definetelly will be restored after course restoring from its backup.
7. Restore "test_backup_course" as a new course from backup file created in p5 with all options by default.
8. Get a problem during restoring on Restore role mappings page: "The test_role role in the backup file cannot be mapped to any of the roles that you are allowed to assign."
So I can not really restore my custom role from a course backup. What I do wrong or may be some another way exists to backup/restore custom roles with original permissions set? Thanks.