Grant ability to Switch Role without granting ability to Assign Role

Grant ability to Switch Role without granting ability to Assign Role

napisao/la Clint Lalonde -
Broj odgovora: 5
We want our Teachers to be able to switch their view to a student view using Switch Roles, but we do not want them to be able to Assign users into that student role. It seems to me that the 2 functions are connected - you can't give someone the ability to Switch to a different role unless you give them the ability to also assign that role to a user. Is this correct, or is there a way to give someone the ability to switch roles without giving them the ability to assign that role?

We're using ver 1.8.


Odgovor na Clint Lalonde

Re: Grant ability to Switch Role without granting ability to Assign Role

napisao/la Séverin Terrier -
Slika Documentation writers Slika Particularly helpful Moodlers Slika Testers Slika Translators
Yes, you're right. As said in the doc, you can't switch to roles you can't assign.

I would also, like you, be interested to allow some roles to switch roles, but not assign them...
Odgovor na Séverin Terrier

Re: Grant ability to Switch Role without granting ability to Assign Role

napisao/la Tim Hunt -
Slika Core developers Slika Documentation writers Slika Particularly helpful Moodlers Slika Peer reviewers Slika Plugin developers
You might hope that if you turned off the Assign roles to users (moodle/role:assign) capability from teachers, but left them with the Switch to other roles (moodle/role:switchroles) capability, then it would work as you want, but it doesn't. I wonder why?

Well that is what the documentation says anyway. It might be worth testing to see if it is true.
Odgovor na Tim Hunt

Re: Grant ability to Switch Role without granting ability to Assign Role

napisao/la Clint Lalonde -
Thanks for responding, Tim. I've tested this and the documented behaviour is correct. Seems that you can't give the ability to switch roles without also giving the ability to assign that role.


Odgovor na Tim Hunt

Re: Grant ability to Switch Role without granting ability to Assign Role

napisao/la Brett Hinton -
The answer I think lies in this bug report in the tracker:

http://tracker.moodle.org/browse/MDL-11313

It seems that the switch role function is not tied only to the switch role capability, but also the assign role capability. Without both of them the ability to switch roles doesn't function.