<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Dave Cohen wrote:<br>
<blockquote cite="mid200707261528.05254.drupal@dave-cohen.com"
type="cite">
<pre wrap="">On Thursday 26 July 2007 10:48, Ron Parker wrote:
[snip]
</pre>
<blockquote type="cite">
<pre wrap="">So, my question is: Why is this hook_db_rewrite_sql code in a custom
module creating a circumstance where views no longer work as user #1
when the same code does NOT create this problem when replacing the
node_db_rewrite_sql function in the node.module?
</pre>
</blockquote>
<pre wrap=""><!---->Sounds like the node.module code is granting access, where your code is not.
Look for enties with realm 'all' in the node_access table.
</pre>
</blockquote>
Actually, it was the exact opposite: My new code was granting access.
I resolved it by adding code that exempts user #1 (or any user with
"administer nodes" permission).<br>
<blockquote cite="mid200707261528.05254.drupal@dave-cohen.com"
type="cite">
<pre wrap=""></pre>
<blockquote type="cite">
<pre wrap="">I'm ThisClose to making this all work after several months of banging my
head against the wall, so any suggestions are much appreciated. Thanks!
</pre>
</blockquote>
<pre wrap=""><!---->
My suggestions are: 1) Install devel module and enable the query log. Look at
the exact SQL that is the result of all the rewriting. And 2) Enable
devel_node_access and see what it has to say. And of course 3) debug your
problem.
</pre>
</blockquote>
I did install devel module. Thanks for the suggestion.<br>
<blockquote cite="mid200707261528.05254.drupal@dave-cohen.com"
type="cite">
<pre wrap="">I'm also going to reiterate what Moshe said earlier. Think long and hard
before implementing your own hook_db_rewrite_sql. The grant hooks can do
quite a lot for you. Sounds like you may know what you're doing - I don't
mean to imply that you don't.
</pre>
</blockquote>
Again, you are right. I actually used the hook_node_access_records()
in another module to create the exact permission grants I needed for
private access to work without hook_db_rewrite_sql(). Problem here is
I've not though through a way to grant permissions that take into
account OG, TAC and Content Access (CA) access control.<br>
<br>
I can assure you I take everything you suggest as an effort to help,
and apprecite it as such. Using the node access API is a much better
way to go, no question about it. I just have not figured out how to do
it as efficiently or effectively as I have with hook_nodeapi and
hook_db_rewrite_sql.<br>
<br>
Thanks for all the help!<br>
<br>
-ron<br>
<blockquote cite="mid200707261528.05254.drupal@dave-cohen.com"
type="cite">
<pre wrap="">-Dave
__________ NOD32 2424 (20070726) Information __________
This message was checked by NOD32 antivirus system.
<a class="moz-txt-link-freetext" href="http://www.eset.com">http://www.eset.com</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Ron Parker
Software Creations <a class="moz-txt-link-freetext" href="http://www.scbbs.com">http://www.scbbs.com</a>
Self-Administration Web Site <a class="moz-txt-link-freetext" href="http://saw.scbbs.com">http://saw.scbbs.com</a>
SDSS Subscription Mgmt Service <a class="moz-txt-link-freetext" href="http://sdss.scbbs.com">http://sdss.scbbs.com</a>
Central Ave Dance Ensemble <a class="moz-txt-link-freetext" href="http://www.centralavedance.com">http://www.centralavedance.com</a>
R & B Salsa <a class="moz-txt-link-freetext" href="http://www.randbsalsa.com">http://www.randbsalsa.com</a>
</pre>
</body>
</html>