Disclaimer: I am a noob
Having the course:activityvisibility permission but not the course:manageactivities permission gives a user the ability to choose "Show" or "Hide" from the kebab menu, but results in an error being displayed when trying to change the visibility of an activity:
nopermissions
|
Sorry, but you do not currently have permissions to do that (Manage activities). |
I am far outside of my area of expertise, but I think the issue may be due to the set_cm_visibility function in course/format/classes/stateactions.php checking for both permissions:
require_all_capabilities(['moodle/course:manageactivities', 'moodle/course:activityvisibility'], $modcontext); |
By removing course:manageactivities from the call to require_all_capabilities on a test server I was able to restore expected behaviour; i.e. Show/Hide works when only having the course:activityvisibility permission.
I am not saavy enough to know what this might break and I wanted to share in case it was a useful observation. We have a situation where we would like a role to have the ability to change the visibility of an activity without otherwise being able to change the configuration of the activity so started digging.
- duplicates
-
MDL-77572 Some course capabilities do not allow the course edit menu (kebab) to display
-
- Closed
-