[development] Restricting hook_db_rewrite_sql
Rob Thorne
rob at torenware.com
Sun Apr 16 20:10:31 UTC 2006
Earl Miles wrote:
>
> That's primarily because most node queries are type agnostic. That's
> why there is a node_access table.
>
Well, yeah. Which I'm using: I've defined a realm field for
node_access for what I'm doing, and among other things, I'm using
hook_db_rewrite_sql to use it;
civinode_get_accesses_for_user($user->uid) identifies which of these
node_access fields is relevant to the current user.
The documentation does not make it clear what it means to be a
$primary_table, although it would help if it did. I only use the field
because in most of the cases I actually want to affect, I assume that
$primary_table is either "node" or an alias to it. This particular
query is failing because Moshe is doing his rewrite with "og" as the
table. I don't need or want to modify his query, but only discovered
the problem via the error logs.
Rob
More information about the development
mailing list