Needs work
Project:
Domain Access Advanced
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
5 Apr 2011 at 18:45 UTC
Updated:
28 Jul 2022 at 22:22 UTC
Jump to comment: Most recent file
Comments
Comment #1
espirates commented+subscribe
Comment #2
Anticosti commentedSubscribing
Comment #3
andros commentedSubscribing
Comment #4
bowmo commentedsubscribe!
Comment #5
artatac commentedSub
Comment #6
torrance123 commentedI've rewritten domain_adv for Drupal 7. Rather than a rewrite hook, it was easier to disable domain access's hook_node_grants() method, and instead use Drupal 7's new hook_node_access(). With this hook, we can deny access if the node isn't accessible from the current domain, and if it is, simply let the request pass (as opposed to explicitly setting it to allow) — this means the rest of the node access system still runs, and organic groups (or whatever) can still deny access once hook_node_grants() is called.
I wonder whether domain should be using this method at its core?
Comment #8
silverwing commentedspam clean-up (excuse the noise)
Comment #9
bowmo commentedtried the 7.x version above in a test environment, 2 domains active in domain access.
put a couple of pages in with links in the main menu, which where only visible on domain 1. But they also showed up in the menu of domain 2. I did get an access denied, when trying to view the page.
Also a note from the api doc, that hook_node_access is not called everytime a node is loaded.. So that might be the reason to the outcome of my tests.
Comment #10
torrance123 commentedI wasn't aware of hook_node_access not being called on every request. From the docs:
So we still need a hook_alter_query *in addition* to hook_node_access to cater for this case. I'm not sure if that's the reason for your menu issue, though, but it's a possibility. I'll have a go at adding the rewrite rule later today.
Thanks for your feedback!
Comment #11
torrance123 commentedHere's the module with an additional hook_query_alter() for removing forbidden nodes from lists of content. I'm still getting my head around the new QueryAlterable/QuerySelect/QueryCondition interfaces, but I think I've implemented this properly. I also spotted a misnamed variable from the code I posted earlier which I've fixed.
This is properly removing content from Views lists for me, and I'd be interested if it fixes the menu issue.
Comment #12
wellsys_world commentedHi torrance123,
I'm using a combination of Domain Access, your Domain Access Advanced module and Content Access.
I have a content type set up using Content Access so that only users with a certain role can access the content type.
Although I have completely configured my two domains, it does seem to be working OK. I'll report back when I have completed my setup of the two sites and tested a bit more thoroughly.
Nice work!
Wellsy
Comment #13
wellsys_world commentedOK,
Did a bit more testing and it broke one of my Views. I got my site working again by ticking "Disable SQL rewriting" for my View and that got it working for me.
Comment #14
demma10 commentedSubscribing.
Comment #15
demma10 commentedApologies for the double post. You can delete this one.
Comment #16
Encarte commented#13
Comment #17
stoptime commentedThank you, thank you, and thank you again. Seems this still does the trick!
Comment #18
torrance123 commentedHi Stoptime (and others reading this thread),
I've since rewritten/adapted a different approach to solve this that works more consistently than the patch in this thread.
The repo for the module is available here (https://github.com/torrance/domain_og_bridge) and see the discussion thread here (http://drupal.org/node/1355272).
Please switch to using domain_og_bridge as it is maintained and works with both OG1.x and OG2.x versions.
Comment #19
adammaloneThanks for a great bridging module - is there any chance this will be moved into drupal.org to become a project?
Comment #20
zeip commentedtorrance123, does that work with other node access modules also? I have a site that's using Domain Access + ACL + Content Access, and for that domain_adv works nicely. With a quick look it seemed that your module handles the specific case of OG + DA, or?
Comment #21
torrance123 commented> torrance123, does that work with other node access modules also?
No, this module only handles the specific case of domain and OG I'm afraid.