Hi,

I'm trying to use Domain strict in order to make 1 of several domain available only for specific people.

I work with a fresh Drupal 7.8 install, I only activated devel for debugging, phpfilter, domain access (2.14) and domain strict.

I created three domain : main.exemple.com, site2.exemple.com, specific.example.com.
Content creation settings set on " only show on selected sites".
User defaults : set "add default roles dynamically", anonymous and registered users are set part of main.example. and site2.example.com, and I created another role "specific" which is the only one to be part of specific.example.com.

But there is no difference with or without Domain Strict activated : content is viewable by every role.
Domain access work : content is not viewable outside of the domain. But Domain strict doesn't work : specific content is viewable by registered and anonymous, and specific.

Devel show me that everyone has a node access. I thought Domain Strict was granting access, so I deactivated the view published content permission, but no content is viewable then, despite the fact that roles are part of a domain.

I don't undertand where the matter lie. This single deactivation make devel to show that there is no more granted permission to view. So domain strict doesn't grant extra permission when activated, but doesn't block user to view specific content. So I think I made an error when installing it but all tests I found on the web to check works fine.

Comments

agentrickard’s picture

Category: support » bug
Status: Active » Needs review
StatusFileSize
new464 bytes

Well, it looks like hook_domaingrants() has been deprecated and the module not updated. I thought we had covered that.

Here's a patch. Apply the patch and then clear the site cache (including the {cache_bootstrap} table).

agentrickard’s picture

Also needs a test....

Shimegi’s picture

It works fine now .. thinking a spend some our to be sure I wasn't making mistake.

Thanks a lot. I'm not very at ease with development stuff so I let you change the status.

Shimegi’s picture

I forgot yesterday,

I applied the patch manually, and there is only one line to replace where the patch replace one with several :

-function domain_strict_domaingrants(&$grants, $account, $op) {
+function domain_strict_node_grants_alter(&$grants, $account, $op) {
   global $_domain;
   // We only act on the 'view' operation.
   if ($op != 'view') {

In fact the three last line are already there, we have to replace
function domain_strict_domaingrants(&$grants, $account, $op) {
by
function domain_strict_node_grants_alter(&$grants, $account, $op) {
only.

agentrickard’s picture

Status: Needs review » Needs work

Yes. See http://drupal.org/patch/apply. Only lines prefixed with + or - are actual changed. This patch is correct.

Marking "needs work" for the test.

agentrickard’s picture

Patch has been committed to both 7.x.2 and 7.x.3. Writing the test now.

agentrickard’s picture

Status: Needs work » Fixed
StatusFileSize
new53.62 KB

Now with tests.

Thanks for the quick review, @Shimegi.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Madhuri A’s picture

Status: Closed (fixed) » Active
agentrickard’s picture

Status: Active » Closed (fixed)

Reopening an issue without comment or detail is just plain rude.