Disallowing block configuration but allowing block movement on the user dashboards

Disallowing block configuration but allowing block movement on the user dashboards

by John Poodle -
Number of replies: 4

I'm going through the various capabilities for my student role and I'm trying to work out how I can prevent my users from being able to configure (cog wheel) their dashboard blocks but still be able to move and hide them. The reason is that for example if I use a HTML block to display a video on dashboards I don't want users to be able to change the content.

I have come across the following capability which I thought did the above, however my students and authenticated user roles have this set to disallow and yet they can still configure all blocks. Moodle docs page.

I don't want to completely prevent users from being able to customize their dashboards. What is the best way to do this?


Average of ratings: -
In reply to John Poodle

Re: Disallowing block configuration but allowing block movement on the user dashboards

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers
I wouldn’t have thought a student could edit HTML

Blocks anyway - but in any event, youcan control permissions at a block level as well as a dashboard (and course) level. So leave the dashboard permission as they were and (with editing on) click the cog in the block/s that you want to restrict editing. One of the options you will see is ‘Permissions’. In the section for “Edit a block’s settings” click the cross next to ‘Student’, which will ‘prevent’ them editing. For good measure, it would be worth adding the student role to the third column, which will ‘prohibit’ that capability.

Average of ratings: Useful (1)
In reply to John Poodle

Re: Disallowing block configuration but allowing block movement on the user dashboards

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers
Ps. Disallowing a capability is NOT the same as prohibiting it. See https://docs.moodle.org/38/en/Override_permissions for an explanation of the 4 permission states.
In reply to Jon Bolton

Re: Disallowing block configuration but allowing block movement on the user dashboards

by John Poodle -
Hi Jon, thank you for that, when I changed the permission to prohibit it worked perfectly. It is amazing how going to advanced mode is actually easier to understand than the default mode smile
In reply to John Poodle

Re: Disallowing block configuration but allowing block movement on the user dashboards

by John Poodle -

Just wanted to add here for the benefit of others, that after further testing I found that changing the permissions didn't actually do the trick at all. I thought it did because I tried one particular block, which also had another setting changed, thinking it was the permission change that did it. When I accidentally tried the other HTML blocks they were still editable.

The actual setting that did the trick was the following:

1) Go to the Default Dashboard

2) Configure each default block and for "Where this block appears", set "Select pages" to "Any page matching the above".

What this magic setting appears to do is treat the blocks now as a single instance, as oppose to each user having their own instance on their dashboard. Now if you try to access your dashboard as a non-admin and click configure, you cannot change any of the settings including the HTML. Only an admin can make these changes and they will update for everyone across the platform.

Hopefully this isn't just a glitch that will be bug fixed later,  because it works perfectly for this use case.