After installing Domain View, I would like to Restrict View access by domain. No role has the "access all views" permission. In the view's access settings I check a single domain XXX. Access to the view is now denied from any domain, including XXX. The view's menu items do not show up, and the following error is issued:warning: Invalid argument supplied for foreach() in /var/www/drupal/sites/all/modules/domain/domain_views/domain_views.module on line 75.
Also, I am not sure I understand the first part of the help string:Only users with the selected permission flag will be able to access this display. Note that users with "access all views" can see any view, regardless of other permissions.
isn't the permission flag associated with domains, rather than users?
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 560156-views-access.patch | 3.83 KB | agentrickard |
| #6 | 560156-views-access.patch | 5.25 KB | agentrickard |
| #5 | 560156-views-access.patch | 5.63 KB | agentrickard |
| #1 | 560156_contributions-modules-domain-HEAD.patch | 902 bytes | nonsie |
Comments
Comment #1
nonsieAccess to the view is now denied from any domainPlease specify which permissions the user/role attempting to view this view on domain XXX has? From the message you got it seems they don't have access to the domain.
This means that the view is only available on the specified domain and only to users that have access to that domain. Look into domain_node_grants() in domain.module for the basic background info. This is later altered by other modules implementing hook_domaingrants() (such as Domain Strict).
The attached patch (against HEAD) should get rid of your error message.
Comment #2
nonsieComment #3
skizzo commentedI had no restrictions, neither by-role nor by-domain, and users could see all views in all domains. The problem was exposed when I tried to enforce a restriction by-domain. The provided patch does fix the problem. Thank you, also for the clarification: it wasn't clear to me because in my context I have no restrictions by-user, and no Domain Strict.
Comment #4
agentrickardThe patch would need to check:
Otherwise, you could still generate the error.
Comment #5
agentrickardOK, I went a little nutty with this patch, sitting in an apartment in Paris. There are two access schemes we might care about:
1) The Domain Strict model, which asks, 'Can this user see content on this domain.'
2) The Domain Editor model, which asks, 'Is this user a member of this domain.'
The attached patch supports both.
Comment #6
agentrickardUpdated and committed.
Comment #7
agentrickardThis broke something in the access check.
Comment #8
agentrickardBetter patch. Committed.