Restrict/Hide users from viewing blocks in Dashboard

Restrict/Hide users from viewing blocks in Dashboard

by Sarath P -
Number of replies: 2

Hello everyone,

Is it possible to restrict a set of users from viewing blocks? Suppose there are 500 users(students) and out of which 250 users are from campus1 and the rest 250 from campus2. Now the dashboard is common for all 500 users. I am trying to hide some blocks so that the campus1 users will only see their blocks. 

I tried creating new roles with Archetype Student for campus1 and campus2 and removed all other roles from the block permission. But still, I am able to view the block. Then I realized that on the dashboard all the users will be "Authenticated user". Is there any other way to achieve this?

Current Moodle version: 3.7.5+

Thanks in Advance.

Average of ratings: -
In reply to Sarath P

Re: Restrict/Hide users from viewing blocks in Dashboard

by Ravi Murugesan -
Picture of Particularly helpful Moodlers Picture of Testers
Hi Sarath - I'm not sure this would be possible on a standard Moodle installation. You may want to consider multi-tenancy. See this discussion and check out Iomad: https://moodle.org/mod/forum/discuss.php?d=402376. Moodle Workplace seems to come with a multi-tenant feature: https://docs.moodle.org/311/en/Multi-tenancy
In reply to Ravi Murugesan

Re: Restrict/Hide users from viewing blocks in Dashboard

by Sarath P -
Hi Ravi,
Thank you for your response. Even if it is iomad, I am not sure whether we can implement the required functionality as the default dashboard is common for all users, right? Or is it possible in iomad to create a separate dashboard for users?
In my case, we have created user profile fields to identify which users are from which campus. I am just thinking, is it possible to add some code to a block let's take the HTML block, and make any restrictions based on the user profile filed and make the block only for let's say campus1 users only?
Please let me know what you think.