I created 2 blocks and configured the user access so block A is only visible to registered users and block B is only visible to a custom role, paid users. I then created a page and set it as composite layout with a single column. I then added each of the above blocks to the only zone available, left sidebar. The intent is to have a single menu item that gives different content to different user roles.

When testing with users of either role I see both blocks present. I believe this is a bug.

Thanks for any information or guidance you can give.

Jim

Comments

bengtan’s picture

Status: Active » Closed (works as designed)

Hmmm... it's actually a design decision that Composite Layout does not honor any of the visibility restriction options usually available for blocks.

I figured that, since Composite Layout operates on nodes, the user wants to manipulate the 'content' part of a Drupal site, not the 'configuration' part (ie. sidebars). Hence if a block is selected to appear in a Composite Layout zone, then it's an appendix to the 'parent node', so it should always appear.

Evidently, my reasoning and your thinking does not quite agree.

The second reason is that honoring block visibility options does not always make sense. Block visibility rules are configured per block per theme. However, Composite Layout displays blocks independent of the theme.

For example, suppose you have the block 'Who's Online' configured to be visible (as a normal block in the sidebar) in the theme Bluemarine, but not visible in the theme Garland. Then you add the same block to a Composite Layout zone for a node. I would argue that a Composite Layout-enabled node should present the same content independent of the theme, but this is ambiguous if Composite Layout tries to honor block visiblity options.

mlbinseattle’s picture

I have the same issue as boftx. I understand your reasoning for not wanting to honor block permissions, but shouldn't the admin get to decide who sees what? I used composite layout because, for some reason, I can't load panels (or views) into my system. (It crashes every time.) So, I'm limited as to what my options are for getting regions inside a page view. I decided to use composite layout because it didn't crash my system during installation. Everything was great until I noticed that the permissions weren't being honored for custom blocks. I'm really disappointed.

One question: If you decided not to honor block permissions, why do core blocks like the login block work (permissions are honored)???

It would really be nice if the admin got to make the decision of who sees what regardless of what theme is being used; however, it is your module.

bengtan’s picture

Hi mlbinseattle,

> One question: If you decided not to honor block permissions, why do core blocks
> like the login block work (permissions are honored)???

That's because the module that defines those blocks have other logic that implements additional visibility criteria. In the case of the login block, the user.module itself hides the block (this occurs before, and is independent of, Composite Layout).

I still stand by my original statement and the reasons of comment #1, but seeing as your situation is rather specific, maybe I might be able to help you find an acceptable compromise. Perhaps create some additional module that adds some features to Composite Layout to meet your requirements. Or help you debug why Views and Panels doesn't work for your site. If you're interested, and can justify it commercially, please contact me through my Drupal contact form.

Thanks.

Nolza’s picture

I have to say that this would be a nice feature to add in. Layouts would be much more configurable, such as different splash pages for different roles. It allows for much more specific (and hence better) tuning towards your targets.

Thanks

Nolza’s picture

Status: Closed (works as designed) » Needs work
bengtan’s picture

Status: Needs work » Closed (works as designed)

Expiring this issue as it is old and uncertain whether it is still applicable.

vistree’s picture

Hi, I really need the same. I want to include a block, which is visible only for anonymouse users - which is replaced by an other block for authentificated users.
Did someone find a workaround????

rmcom’s picture

Dear bengtan,

Thank you for this wonderful module!

I wholeheartedly agree with your reasoning in #1 and #3, but I have also come across the other use case described above.

A great solution would be to add a check box next to each block under the 'Zones' tab in the 'Additional settings' column that would allow to check "activate block permissions."

Do you think that this would be (a) feasible and (b) not disturb the rest of the functionality that this module provides?

rmcom’s picture

Version: 6.x-1.0-beta5 » 6.x-1.0-beta8
Category: Bug report » Feature request
Priority: Normal » Major
Issue summary: View changes
Status: Closed (works as designed) » Active