Closed (works as designed)
Project:
Domain
Version:
6.x-2.7
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Jan 2011 at 08:50 UTC
Updated:
30 Mar 2011 at 02:09 UTC
Hy,
how do to permit usersers without "administer nodes" to see all nodes?
The Function domain_db_rewrite_sql
Only permit it for users with this rights.
For me this seams to be a error in:
domain.module: function domain_db_rewrite_sql
if (!$admin_force || $primary_field != 'nid' || !user_access('administer nodes') || domain_grant_all()) {
I changed it in:
if ((!$admin_force && user_access('administer nodes') ) || $primary_field != 'nid' || domain_grant_all()) {
Or do you use for un previliged users another methode to restrickt the acces to nodes with are not on this domain?
Comments
Comment #1
agentrickardYou are not stating your problem clearly.
This report suggests that non-privileged users _can_ see all nodes, which is not true.
Are you trying to _allow_ non-privileged users to see all nodes?
Please restate more clearly. I have changed the title to reflect what I think you are asking.
Comment #2
agentrickardNote that the function you are discussing, domain_db_rewrite_sql() _adds_ additional restrictions not applied by the code node_db_rewrite_sql() -- which does not apply to users who can 'administer nodes'. So you're looking in the wrong place.
Normal access restrictions are enforced by node_db_rewrite_sql() and the core Node Access API.
I suspect you want either Special Page Requests, see 4.5 of README.txt, or to set some nodes to 'all affiliates.'
Comment #3
greenrover33 commentedThanks: agentrickard
And this shoudl also work while using views?
If yes, then i need to check my patches.
Comment #4
agentrickardYes. It should, because Views respects node access.
Don't patch the DA module. The issue here is that node access rules are applied to all users _except_ user 1 and users who can 'administer nodes'. The domain_db_rewrite_sql() bit is designed to add query filters to those users, which can avoid confusion when administrators are previewing the site.
#615294: Force node access rules on admins has the background on this feature.
See also:
http://api.drupal.org/api/drupal/modules--node--node.module/function/nod...
http://api.drupal.org/api/drupal/modules--node--node.module/group/node_a...
Comment #5
mikeytown2 commentedWe have a xml feed generated by a view and we do not want to enforce any domain access restrictions on it.
I'll be creating a skip domain access enforcement patch for use in views, using
$args['view']in domain_db_rewrite_sql(). I'll create it as a filter under "Domain Access"; it would be an "anti filter".Alt to patching is implement hook_views_pre_execute where I set the user to UID 1 and $conf['domain_force_admin'] = FALSE and then in hook_views_pre_render unset those changes. This doesn't sound like a solid solution so I'm looking at patching domain access.
Comment #6
mikeytown2 commentedLooks like I can add in an exception on the Special page requests setting on admin/build/domain/settings.