I don't think that the issue strictly belongs here but since you have worked a lot on the MNAP patch, it might be the best place to seek clarification
1) Our Use Case
We are using Domain, OG and Forum Access module all of which have their access permissioning.
From what i gather about the MNAP(i understand is primaliry for OG and domain access) AND logic a user should have access to a post in an OG say, only if he has access to both the domain and the OG, or it is published to allaffiliates and is OG public.
This works perfectly.
What is the desired behaviour if it is a POST in the domain but not in an OG, so no OG or OG public is selected?
Again if the setting is AND then what i see is a user is NOT allowed to view the node. For us the expected behaviour was that he should be.
Are my statements accurate? Is the desired behaviour outside the purview of MNAP?
Regards
Santosh
ADDENDUM
We are using an alternative to this patch currently. Would really appreciate your comments/view on whether this logic holds weight
1) Fetch the grants from all modules, use the new "Group" logic
2) Loop through groups
--- For each group check if the user has permissions, somethign like
$sql = "SELECT COUNT(*) FROM {node_access} WHERE nid = %d and ( $grants_og_sql) AND grant_$op>=1";
--- If not exit with a false
--- if he has move to next group
3) If it reaches end return true
This may be faster than the current MNAP patch and also works for our use case better
THe flip side is we had to come up with a completely different code for _node_access_where_sql
Comments
Comment #1
santosh.rj commentedOops, modification to the logic in addendum(sorry about this)
1) Fetch the grants from all modules, use the new "Group" logic
2) Filter and make a list of groups that this node belongs to
3) Loop through groups filtered
--- For each group check if the user has permissions, something like
$sql = "SELECT COUNT(*) FROM {node_access} WHERE nid = %d and ( $grants_og_sql) AND grant_$op>=1";
--- If not exit with a false
--- if he has move to next group
4) If it reaches end return true
Comment #2
agentrickardThis logic works in cases where using AND grants. How does it apply to OR grants?
See also http://drupal.org/node/264092 -- does this approach solve that problem?
As for the OG issue, see http://drupal.org/node/234087 -- this is a problem that occurs when OG does not declare grants for certain node types and you try to use the AND logic.
Comment #3
agentrickardComment #4
agentrickardClosed for lack of follow-up.