I set up a Relevant Content Bean and configured a new block that works perfectly for the admin user. I set the permissions "Relevant Content Block: View Bean" to a allow anonymous and authenticated users but the block does not show up for either of those users. If I additionally set the "Relevant Content Block: add Bean" permission then the block appears. If I unset this additional permission again and change back to only have "Relevant Content Block: View Bean" then the block no longer appears for anyone but the admin user.

No special permissions/restrictions are set at the block level.

Note that I've also setup another bean that uses View Reference and the permissions work as expected there.

Comments

dunlop’s picture

Issue summary: View changes

Remove extra word

seanberto’s picture

Status: Active » Postponed (maintainer needs more info)

I can't replicate this bug on a clean install of the following:

Drupal 7.14
Bean (bean) 7.x-1.0-rc5
Bean: Relevant Content (bean_relevant) 7.x-1.1
Chaos tools (ctools) 7.x-1.0
Date (date) 7.x-2.5
Entity API (entity) 7.x-1.0-rc3

Nor have we encountered this issue on the 7 client sites we have running the module.

That doesn't mean that it's not an issue. Could you confirm that you're testing on a clean environment? Could you list the modules that you are using in conjunction with RCB?

dunlop’s picture

I have all the same versions of the modules you list:

Drupal 7.14
Bean (bean) 7.x-1.0-rc5
Bean: Relevant Content (bean_relevant) 7.x-1.1
Chaos tools (ctools) 7.x-1.0
Date (date) 7.x-2.5
Entity API (entity) 7.x-1.0-rc3

I also have:

View reference 7.x-3.3+8-dev

which I am using through a bean that allows me to pass arguments from a bean block to a view. As I mentioned before, the permissions on this standard bean work as expected.

I have many other modules which may or may not affect Bean: Relevant Content. However, I wondered if my results are more related to the settings I am using on the bean block. I tried using all of the default settings and the block does show for anonymous users ok. If I change to use "Filter by taxonomy terms contextually" then the block no longer appears for anonymous but does still work for admin users. I did not initially restrict the taxonomy vocabularies, but did later and that did not show the bean block for anonymous users either. This contextual taxonomy filter setup is how I wish to use the bean and how it was setup for my initial report.

dunlop’s picture

Status: Postponed (maintainer needs more info) » Active
seanberto’s picture

Status: Active » Postponed (maintainer needs more info)

Sorry, Dunlop, I still can't replicate this issue. On a fresh install of the modules listed above, I can filter the RCB results contextually by taxonomy term. View access to this block works correctly with the "View Bean" permission for all roles (including anonymous).

It's possible that something else in your setup if affecting this. EntityFieldQuery does respect node access control. So, if you've got other modules enabled that affect access control, that could be what's causing the issue.

Please let me know if you can replicate this issue on a flesh install of Drupal core and the modules above. Again, I don't mean to say that your bug report isn't real. It's just not something that I can replicate on a fresh installation of Drupal, or on any of our client sites actively using the module to show content related by taxonomy to anonymous site visitors.

dunlop’s picture

Status: Postponed (maintainer needs more info) » Active

Ok, I used a fresh install and I used Devel to generate taxonomy terms and content. I can confirm the same behaviour as before.

However, I noticed that when the block did appear for anonymous it was surprising similar on every page (I had 'Exclude current node' set). I compared the results for a few pages for anonymous vs admin and found them to be different. The results for admin were changing as expected and the results for anonymous were not. I suspected that the results for anonymous were coming from a cache and admin results were not.

So I played with my cache settings and found that turning off block caching led to the expected relevant content results which changed for each node for anonymous users too. Also turning on and off "Relevant Content Block: View Bean" correctly and immediately changes the display of the block.

I believe the difference between the results I saw when using the default bean setting vs using "Filter by taxonomy terms contextually" is also consistent with a caching problem.

I am marking this as works as designed because I no longer believe this is a bean issue. An additional complication to the block caching problem is that I run on nginx and not apache and nginx does some caching too.

dunlop’s picture

Status: Active » Closed (works as designed)
dunlop’s picture

The Bean module has a few issues related to caching. The most relevant issue is #1216580: Ability to specify block caching level

dunlop’s picture

Issue summary: View changes

Clarified wording