Hiding a block from students not working.

Hiding a block from students not working.

by Rahul Ajani -
Number of replies: 3

Hi everyone, I am facing this strange problem which took me hours to no avail. 

I have installed Moodle 2.4.3+ (Build: 20130411). I created Parent Role in Moodle to give parents access to the grades of their children. Some parents (actually most of them) are not tech savvy, so I made a video with instructions on how to check grade of children, and then I made an HTML block, embedded this video, and kept this block on My Homepage (in the content area). And I made My Homepage as default landing page after login for all users. So, when parents login, they would see the mentees block with name of their children, and below that is this instructional video. 

Then I turned editing on, clicked on the "Assign Roles" icon for the new HTML block, set permissions so that only Parents can see this block and no other roles see this block. Then I made Parent role global for the parent users I had, so that even when they are on My Homepage they have "Parent" role. Now the parents could see the block with instructions when they logged in, but...

The problem is: even students, managers, administrator, everybody else is also able to see this block. I scoured through all articles, checked permissions in the "Define Role", checked permission overrides in the HTML Block, tried adding "Authenticated Users" and "Authenticated Users on Front Page" etc. in "Prohibited" tab of the block permissions, but nothing works. 

Stuck! I spent whole day yesterday. I cleared (purged) Moodle cache several times, cleared the browser tabs, checked on different computers, but nothing works. Please help! sad

Average of ratings: -
In reply to Rahul Ajani

Re: Hiding a block from students not working.

by Christian Herman -

1. Is moodle:block/view set to Allow for Authenticated Users and Authenticated Users on Front Page?  If so, change to Not Set.  That should do it.  If not...

2. Ensure that the HTML block's Permissions have all prohibited roles in the Prohibit column for moodle:block/view.  Adding the authenticated user roles here won't do anything if the more granular roles of Student, Manager, etc. are allowed.

In reply to Christian Herman

Re: Hiding a block from students not working.

by Rahul Ajani -

Hi Christian, 

The role/permissions stuff really seems complicated. When I turned the moodle:block/view permission to not set for Authenticated Users and Authenticated Users on Front Page, then students couldn't see any single block including navigation block, etc. on "My Homepage", and they only see blank page with only the logo and footer. Also parents couldn't see any blocks when they logged in, too. That's because I guess Parents and Students have "Authenticated User" role on the My Homepage. From what I understood, users normally have different roles on different pages of the site (unless they are assigned "System" role).

Before I posted this issue, I tried adding other roles in "Prohibit" column of the moodle block, but that didn't solve the problem. 

Anyways, I found a workaround, I assigned Parent role in System. So the parents have "Parent" role even when they are on My Homepage or any page in the site. And then I hacked the Mentees block and added whole video with instructions etc. in the Mentees block. So now only parents see this block, and others don't see it at all.