I currently have to rebuild the permissions manually for the effects to take place.

My current workflow:

Go into a book
Select book access
Allow a role to view the book
Click Save configuration
*goes through rebuild book access permissions
+Now I have to go into admin/content/node-settings and click Rebuild permissions

If I do not rebuild permissions via admin/content/node-settings the user will not be able to view the book.

CommentFileSizeAuthor
#6 book_access-batch_fix-1219192.patch1.09 KBgdl

Comments

venutip’s picture

It sounds like I'm having the same (or similar) issue as @ducke. Until I rebuild the permissions, ALL roles can view the book.

After creating a top-level book page and setting the permissions using the Book access tab, I get these messages from Devel node access when I view the node:

<<
You have errors in your {node_access} table! You may be able to fix these for now by running Rebuild permissions, but this is likely to destroy the evidence and make it impossible to identify the underlying issues. If you don't fix those, the errors will probably come back again.
DON'T do this just yet if you intend to ask for help with this situation.
>>

Right before that is a table with node access information:

node	prio	status	realm	gid	view	update	delete	explained
1617	?	alien	all	0	1′	0	0	All users may view this node.
1617	0	empty	book_access_role	1	0	0	0	Grants for users of role anonymous user
1617	0	empty	book_access_role	2	0	0	0	Grants for users of role authenticated user
1617	0	empty	book_access_role	3	0	0	0	Grants for users of role Webmaster
1617	0	empty	book_access_role	4	0	0	0	Grants for users of role Content Editor
1617	0	empty	book_access_role	5	0	0	0	Grants for users of role Blogger
1617	0	empty	book_access_role	7	0	0	0	Grants for users of role Alumni
1617	0	empty	book_access_role	8	0	0	0	Grants for users of role Student
1617	0	empty	book_access_role	9	0	0	0	Grants for users of role Forum Moderator
1617	0	empty	book_access_role	10	0	0	0	Grants for users of role Adult Learner
1617	0	missing	book_access_role	11	1	0	0	Grants for users of role Online Learner

Hovering over the first entry, I get a tooltip that says, "Should NOT be in {node_access} because of unknown origin!"
Hovering over the last entry (the one role I gave access to), the tooltip says, "Should be in {node_access} but isn't!"

venutip’s picture

Should also mention that I have the following additional access modules installed:

Protected node
Forum Access
ACL (required by Forum Access)

75300’s picture

The same problem. Works only after I rebuild permissions manually.

75300’s picture

Priority: Major » Critical

Manually changing permissions in node_access table works but the module itself doesn't change anything. Being not a tech guy I just thought about what had changed at my website recently what could prevent the module from working. Our hosting provider changed php version 5.2 -> 5.3, could this be the reason?

No other access modules have been installed.

I'm changing the priority to critical.

radler’s picture

I can add that I am using PHP 5.3 as well. I have not used this module in 5.2, however.

gdl’s picture

Status: Active » Needs review
StatusFileSize
new1.09 KB

Hello,

I've been having the same problem. Making changes to the role permissions on the book access form and saving the form led to the book_access_roles table getting updated properly, but the grants in the node_access table were not updated properly. Manually invoking node_access_acquire_grants on a node in the book would add the proper entries in the node_access table for that node, as would rebuilding the node_access table in its entirety.

It turns out that there were two issues with the batch job to rebuild the node_access grants for all nodes in the book when the book access form was submitted. I've attached a patch which fixes those two issues, and causes the appropriate updates to the node_access table to be created when saving the book access form.

I only use roles for book access control, so this should be considered untested for restricting access to books by individual users.

Thanks for book_access!
-G

thelee’s picture

Status: Needs review » Postponed (maintainer needs more info)

6.x is "end of life" since I'm the only active maintainer and don't have a 6.x setup. If someone else in the community wants to test this patch and verify that it works, I can create an unsupported release and apply this patch.

thelee’s picture

Assigned: Unassigned » thelee
thelee’s picture

Status: Postponed (maintainer needs more info) » Active

actually, now that i'm looking at this, it could be a 7.x issue as well, so i'm putting it back into active. BUT like i said, i cannot attest to whether or not this patch is good for 6.x unless someone else can sign off on it.

thelee’s picture

Status: Active » Needs work
radler’s picture

Sorry I didn't get back sooner. The patch in #6 is working for me. Haven't seen any errors and permissions are being applied via the Book access module without extra steps.

thelee’s picture

Thanks ducke - I'll try to get that patch into the 6.x branch relatively soon.

thelee’s picture

Status: Needs work » Fixed

This patch has been applied and pushed to the 6.x-1.x branch. Should be live soon. If there are any problems (since I can't test it), let me know.

thelee’s picture

Final FYI - created a new (unsupported) release 6.x-1.0-rc9 which has this fix, should be live on drupal.org soon.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.