Attached patch restricts content to the specified domain regardless of the user's permissions.

It does so by forcing a JOIN on {node_access} that introduces an AND clause to the WHERE.

Two questions:

1) Does the patch work? That is, does it break anything?

2) Does the patch work as desired?

Comments

agentrickard’s picture

StatusFileSize
new1.25 KB

Last patch had two typos and a stuff function. Fixed.

agentrickard’s picture

Status: Active » Needs review
agentrickard’s picture

StatusFileSize
new1.51 KB

For users that invoke node access checks, we have to use a different table prefix in our join statement.

derjochenmeyer’s picture

In my sandbox it didnt break anything

Works as desired. :)

agentrickard’s picture

I think the question is: on one.example.com, do we show posts assigned just to that domain, or to that domain plus 'all affiliates'?

But I think that has been answered correctly by this patch. Show 'all affiliates' as a separate link.

derjochenmeyer’s picture

yes, it just works as expected, very intuitve.

agentrickard’s picture

Status: Needs review » Reviewed & tested by the community

And, notice, it doesn't interfere with db_rewrite_sql(), so it isn't a hack.

RTBC.

agentrickard’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Committed to HEAD.