Make blocks visible only to selected users
With some help from Moodle forums, I ended up using a combination of solutions as none seemed to work on their own.
- In Administration > Site administration > Users > Permissions > Define roles, select ‘authenticated user on the front page’
- Click edit and then select ‘block’ in the ‘context types where this role may be assigned’ section
- At the bottom of the page, Set moodle/block:view to “allow”.
- Save the changes.
- Go to the page where the block appears and turn editing on.
- From the block actions menu, select ‘Assign roles’
- Click ‘authenticated user on front page’ and add the users who need to see this block (eg. teachers)
- Select ‘Permissions’ from the Administration block on the left.
- Next to the ‘view block’ option, remove all roles except ‘authenticated user on the front page’
- Job done!