question about block_roles

Events happening in the community are now at Drupal community events on www.drupal.org.
jdidelet's picture

Hi,

Anyone knows how we can set blocks_roles properties in code? I mean, I want to set in code (in hook_block ?) the properties about the role specific visibility.

Thanks !

Comments

In hook_block() with $op ==

hswong3i's picture

In hook_block() with $op == 'view', you can manually check the permission or something else, then insert (or not insert) anything into $block['subject'] and $block['content']. E.g. check user permission with user_access().


Edison Wong
CEO, Co-founder
PantaRei Design Limited

Thanks for your help. Yes I

jdidelet's picture

Thanks for your help. Yes I think it's the best solution.


Julien Didelet
Founder
Weblaa.com

What about Drupal 7 Block

ramsunvtech's picture

Guys,

Its works for drupal 6 and what about drupal 7 block_roles rather than doing it by db_update to {block_roles} table.

Kindly let me know your feedback.

Regards,
Venkat

DrupalHK

Group categories

HKDUG Vocabulary

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: