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

agentrickard’s picture

Title: User without "administer nodes" permiossion can see all node » Let users without "administer nodes" permiossion see all nodes
Category: bug » support

You 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.

agentrickard’s picture

Note 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.'

greenrover33’s picture

Thanks: agentrickard
And this shoudl also work while using views?

If yes, then i need to check my patches.

agentrickard’s picture

Status: Active » Closed (works as designed)

Yes. 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...

mikeytown2’s picture

Title: Let users without "administer nodes" permiossion see all nodes » Let users without "administer nodes" permission see all nodes
Category: support » feature
Status: Closed (works as designed) » Active

We 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.

mikeytown2’s picture

Status: Active » Closed (works as designed)

Looks like I can add in an exception on the Special page requests setting on admin/build/domain/settings.