Domain override default permissions
kenorb - September 10, 2009 - 11:51
| Project: | Domain Access |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I've got node 181 in node_access as follow:
181, 0, 'domain_id', 1, 1, 1
181, 0, 'domain_site', 1, 0, 0
181, 5, 'view_own_role', 1, 0, 0
181, 82, 'view_own_owner', 1, 0, 0It shouldn't be visible for all users, but it's.

#1
Related issue: #400268: published content displays on all sites
#2
Yes, it should. The second row means: "Show this node on all affiliate sites."
Use Devel Node Access module, and it will explain what these rows mean.
Using multiple node access modules (which you are apparently doing) uses an OR based permission system. So if either system grants access, the user gets access. You may need a custom integration module to make the two modules work together. You can use hook_domaingrants() and hook_domainrecords() to modify how DA behaves when the other module is present.
#3
Why it can't set default permission that are already set?
Like View Own module doing that in _get_default_permissions() ?
function _get_default_permissions() {$result = db_query("SELECT r.rid, p.perm FROM {role} r INNER JOIN {permission} p ON p.rid = r.rid");
$perms = array();
while ($row = db_fetch_object($result)) {
$perms[$row->rid] = explode(', ', $row->perm);
}
return $perms;
}
Why I should use hook_domaingrants and hook_domainrecords if I need my default permission which I already set?
#4
What?
I don't even understand your question. The two permission systems are entirely different and _stepping on each other_ because Node Access applies OR logic to the grants.
You would use hook_domaingrants() to _remove_ the 'domain_site' grant and possbly the 'domain_id' grant so that View Own can have the only say in content access.
#5
Thanks, I'll try to remove this domain_site grant.
#6
I can't find the format of hook_domaingrants().
Nothing in documentation, README and no examples.
Any help?
#7
Look again. API.php.