I do not want pupils to be able to see a HTML Block on the front page

I do not want pupils to be able to see a HTML Block on the front page

by Mike Baldwin -
Number of replies: 3
I have created a VLE tip of the day HTML block on the front page. I only want the teaching staff to see this. When I click on Roles it only lists the 2 administrators as potential users. At the moment anyone who logs in can see this tip of the day, there does not seem to be a way of only displaying this block to select users. Anyone manage to get over this?
Average of ratings: -
In reply to Mike Baldwin

Re: I do not want pupils to be able to see a HTML Block on the front page

by John Isner -
All users, by default, are assigned the role of Authenticated user in the System context when they login. The Authenticated user role has moodle/block:view ("View block") = Allow. This is why all users can see blocks on the Front page. To allow only the teaching staff to view the Tip of the Day (TOTD) block, here is what I would do:
  • create a new role CanViewBlock with moodle/block:view = Allow and all other permissions Not set
  • assign CanViewBlock to all teachers in the Front page context (*)
  • override the Authenticated user role in the TOTD block context, setting moodle/block:view = Prevent
(*) I would have preferred to assign CanViewBlock to all teachers in the TOTD block context, but for some reason, the list of potential users in the assign roles interface in the TOTD block context is empty.

FYI I have attached screenshots of the Role debugger output showing the permissions for a (typical) teacher and a (typical) student in the TOTD block.

Attachment hiding_a_front_page_block_from_students.png
Average of ratings: Useful (1)
In reply to John Isner

Re: I do not want pupils to be able to see a HTML Block on the front page

by Mike Baldwin -
Thank you, I will give this a try
In reply to Mike Baldwin

Re: I do not want pupils to be able to see a HTML Block on the front page

by ian lake -

There is an alternative, a block is listed in the modules and plug ins database called role specific html block which allows you to specify who should see the information.

Ian