Steps to reproduce:
- Add a block to the dashboard.
- Configure the block and limit visibility by role
- Load dashboard as a role that was not selected as having permission to view the block
- Empty block appears on dashboard instead of being completely invisible
I want to customize the dashboard to have different blocks for different roles as their responsibilities are completely siloed. It isn't helpful to have a slew of "empty" blocks cluttering the dashboard for different roles.
This should be consistent with the way blocks work everywhere else in Drupal and not render period.
Comments
Comment #1
ankur commentedLooks like the ticket for the original implementation of this took place in #544360: D7UX dashboard module. The idea of outputting "(empty)" begins in comments #149 and #150 in that issue.
I agree, however, that the presentation of an empty block should be different from the presentation of a block for which the current user does not have access, in that the block should not be displayed at all for the latter situation.
Currently, the code in
function dashboard_page_build()doesn't make this distinction. I'm wondering if it should do adrupal_alter('block_list', ...), which is how the access control for blocks is enforced in the block module when blocks are loaded and rendered elsewhere.Comment #2
marcingy commentedDuplicate of #1009872: Dashboard does not work with hook_block_list_alter(), exposes all blocks from the database