Block view permission(moodle/block vs block/custome-block)

Re: Block view permission(moodle/block vs block/custome-block)

by Mike Churchward -
Number of replies: 0
Picture of Core developers Picture of Plugin developers Picture of Testers

I'm not sure you would want to check against the system context. You would probably want to check against the block's context. So,

has_capability('block/hell_cap:view', $this->context)

If someone has the ability to edit a page containing the block, then yes they should be able to see the block, even without content.