danmarsden / moodle-mod_dialogue

Dialogue Module for Moodle
27 stars 35 forks source link

Request - add option to allow user to see only teachers in the dropdown list. #102

Closed turf212 closed 2 years ago

turf212 commented 2 years ago

It seems that one of the Moodle patches in 3.9.1 or .11 has changed the way that getting course participants works. When you create a new dialogue the drop down contains a list of all of the course participants whereas previously, if the capability for moodle/course:viewparticipants was turned off for the student role then it would return the list of teachers only. This no longer works and you get a no permissions error. Turning this cap back on then shows all of the course participants. Normally this isn't an issue but we have a use case that students should only be able to contact the teachers - not each other.

I guess this would need a new option in the activity settings (show everyone or choose 1 or more roles to display) and then changng the webservice to filter on these roles. It doesn't look like the course_enrolment_manager->search() function allows for that though.

licethrey91 commented 2 years ago

Version 3.4 of the mod_dialogue plugin allowed to create activities and assign roles to the permission (mod/dialogue:receive) at the activity level. But now the activities are not currently taking these permissions.

Now when the role is assigned at activity level all the enrolled users are shown, the permission is taken at course level.

We found the following documentation about the plugin code for posterior versions. https://github.com/danmarsden/moodle-mod_dialogue/commit/095ca9c2498e49c6a81b40ab53b879fe8e50f7ee

It would be important if the plugin can be reconfigured to allow assigning roles at activity level again.

danmarsden commented 2 years ago

@licethrey91 that sounds like a different request from @turf212 but would require the coursemodule id to be passed to the custom webservice so that it could use the coursemodule context instead - feel free to submit a pull request to improve it or get in touch privately if you would like to fund improvements - thanks!

licethrey91 commented 2 years ago

Thank you @danmarsden for your prompt reply, in this order of ideas I have created the issue https://github.com/danmarsden/moodle-mod_dialogue/issues/103.

I am attentive to any information.