Block visibily condition programatically I want to display a block I implemented in a module when $_SESSION['Group_id'] is set.

How can I achieve this?
In the block ::build() method, return an empty array() if the condition is false.