Client or not, etc.

Comments

anarcat’s picture

This is controlled by the node_access system, normally, so any query that will have a db_alter() thing should "just work".

Try creating a second client and adding different users to each to test this.

Anonymous’s picture

I don't think we have node_access per platform though.

We have a function _hosting_get_allowed_platforms($user->uid); which you might be able to use to return an array of allowed platforms. Then filter your db query so it only displays the platforms as defined by this function?

Maybe?

helmo’s picture

Status: Active » Needs review
StatusFileSize
new1.53 KB

I tested this with a dummy client who only has access to one site. This was broken.

After cleaning up the SQL squery this was solved. I suspect that the capitalization of WHERE was the problem.

And even without extra filtering only the right site was displayed.
It seems that expect db_rewrite_sql() handles this correctly.

clemens.tolboom suggested that it might be needed to call db_rewrite_sql a second time with 'n2' as basetable. I'm unsure however.