Hello all,

I just imported a bunch of book pages into Drupal by generating the SQL directly. I did this as admin, and I imported them with node and node_revisions uid = 1. This worked great, but now I'm trying to let other users edit those files, and having trouble.

I created an editor role, assigned it to a user, and gave it all the book permissions (I even tried giving it administer nodes), but that user still can't edit the book pages. Okay, so I can a quick 'UPDATE node SET uid = 2' (my new userid), 'UPDATE node_revisions SET uid = 2'. Still, permission denied. Even though I'm the owner!

Lastly, I edited one of the book pages with the admin account, and then I saved it (with author set to the new user).

NOW this page is editable by the new user, but all the other pages are still not editable.

So my question is, what other table got updated when I saved the node as admin that made it so the new user can edit that node? Because I want to bulk update it for all 1200 or so records. I really don't want to do that by hand :)

Thank you so much.

Nick

P.S. running Drupal 5.1 with several modules but none that affect access control as far as I know

Comments

mdixoncm’s picture

I hate problems like this! When it really should work but just doesn't :)

Do you have anything in the node_access table?

Like books? Check out booktribes the new (Drupal based) community for book lovers
from Computerminds

Nick Urban’s picture

mysql> select * from node_access;
+-----+-----+-------+------------+--------------+--------------+
| nid | gid | realm | grant_view | grant_update | grant_delete |
+-----+-----+-------+------------+--------------+--------------+
|   0 |   0 | all   |          1 |            0 |            0 | 
+-----+-----+-------+------------+--------------+--------------+
1 row in set (0.00 sec)
Nick Urban’s picture

"In determining access rights for a node, node_access() first checks whether the user has the "administer nodes" permission. Such users have unrestricted access to all nodes." (http://api.drupal.org/api/HEAD/function/node_access).

You're exactly right, md. This *should* be working fine, at least as long as I have "administer nodes" set.

Nick Urban’s picture

It turns out the reason I couldn't edit the book pages is because I had imported them with their filter set to "Full HTML".

As soon as I added the new "editor" role to the "Full HTML" roles list, everything worked as expected.