How do I hide a block or what have you?

How do I hide a block or what have you?

Liam Cuff -
Erantzun kopurua: 1

Seriously I have no idea how to hide anything (such as a block) from one user but show it for another (I'm trying to give staff secret menus so they can pass files to each other, make them hidden etc). This tutorial (

) is great for 1.9 but I'm maybe using version (actually there doesn't even from my research too be able to find what version I'm using) 2.4 and I'm having some difficulty. I've been trying to hide a block from a teacher but to no avail. Please help - this is something really simple and yet so important. Thanks.

 

Liam

Puntuazioen batez bestekoa: -
Liam Cuff(e)ri erantzunda

Re: How do I hide a block or what have you?

Davo Smith -
Core developers-ren irudia Particularly helpful Moodlers-ren irudia Peer reviewers-ren irudia Plugin developers-ren irudia

In the get_content() function:

Check the capability of the user that you are interested in.

Return NULL if they do not have the capability that allows them to view the block.

(Note the block will still appear to teachers if they switch editing on, but it will be hidden when editing is off).