In Drupal 5, we added the ability to control block visibility with PHP, which is a nice feature. However, this means:

a) We're storing code in the database... blech!
b) There's no way for a module to override block visibility settings globally, without writing some custom PHP itself, which is... hackish at best.

One solution is to create an 'access' operation for hook_block. This would require changing the middle parameter of hook_block from $delta to $block, so all block properties are passed in; that way you could act on blocks created by another module.

Here's a tiny start at a patch. All the hook_block implementations need to be converted, and I haven't actually tested this to see if it works, but it might. :P

Due to major RSI issues, this is as far as I can take this patch before the D6 code freeze, but if someone else wants to hammer it home, feel free. Else, it'll make a nice patch for D7.

CommentFileSizeAuthor
block_access.patch6.36 KBwebchick

Comments

chx’s picture

Version: 6.x-dev » 7.x-dev
dropcube’s picture

Status: Needs work » Closed (won't fix)

Please, follow up here: http://drupal.org/node/257032