this is an extension patch of http://drupal.org/node/168403. by using access_*(), block visibility will able to define in Apache-mode, with Apache mod_authz_host syntax. e.g. if we hope to display a block for front page, user login page and admin pages only, we can define rules as:

Order Deny,Allow
Deny from all
Allow from <front>
Allow from user
Allow from ^admin.*

default style will be define as Order Deny,Allow. therefore if NO rules defined, the behavior will equal as "Show on every page except the listed pages." with empty rules.

Comments

hswong3i’s picture

StatusFileSize
new7.38 KB

minor update: bulky code cleanup, minor bug fix.

a small bug with no idea: if use <front> and then change front page setting, rules will not update since cached. a simple re-submit of block configuration page can solve this problem.

patch required: http://drupal.org/node/168403#comment-295952

hswong3i’s picture

Version: 6.x-dev » 7.x-dev
Status: Needs review » Active

sorry that this patch IS TOOOOO late within D6 development life cycle, and so i will postpone it for D7.

BTW, please consider about its powerful feature: we will able to define rules with a very powerful syntax, with very flexible handling, on the other hand without implementing our own filter rules by using complicated PHP-mode syntax (which is usually something TOOOOO much for normal site and project maintainers).

P.S. this syntax is something that i am even DREAMING for, during implement http://asia.playstation.com/ (a Drupal 4.7 + Oracle project). i can't imagine how many OT hours can be saved, if we are able to have this feature 1 year ago ;p

lilou’s picture

Status: Active » Needs work

Patch no longer works against HEAD.

Such feature should be in a contrib module. Related discussion : #228594: UMN Usability: split access rules into an optional module

casey’s picture

I agree this definitely should be a contrib module.

Instead of pushing this to D8 a suggest setting this to won't fix.

Feel free to reopen however.

casey’s picture

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

whoops