Block Access Privileges for Single User

Block Access Privileges for Single User

by Qadeer Ahmad -
Number of replies: 4
I want to add a block but only a particular user has the privilege to see it other than admin, teacher & student role. What should I have to do? Any Help.
Average of ratings: -
In reply to Qadeer Ahmad

Re: Block Access Privileges for Single User

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Blocks don't have a 'view' capability (usually anyway) so you can't do that. It would settle it if you told us which block?

In reply to Howard Miller

Re: Block Access Privileges for Single User

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

There are a few blocks with the capability moodle/block:view so you could make a new role, add it to the block context and set it to allow for that role and prevent for other roles and then assign it to the one particular person. But you need also to think where the block will be visible  because users have different roles depending on where they are on the site and so visibility may change. For some inspiration, take a look at the relevant questions in Blocks FAQ

In reply to Mary Cooch

Re: Block Access Privileges for Single User

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Naturally, the random sample I looked at didn't blush

In reply to Howard Miller

Re: Block Access Privileges for Single User

by Randy Thornton -
Picture of Documentation writers

I think that's another one for the 'consistently inconsistent' pile mixed

Average of ratings: Useful (1)