I needed to set the priority of book access so had to hack the module (just the 'priority' => 1, line). I'm wondering if there's a way of doing this from the UI so that I don't have to hack the module...?

Comments

Anonymous’s picture

Status: Active » Postponed

I remember I wanted to add a setting for the grant priority, but I was said that it was not necessary, as once a module didn't grant a permission, there was nothing the other modules could do. Reading the documentation for hook_node_access_records(), I see that the priority influences the permission being given.

I will add an option to set the priority. I have to first re-write the code to remove the dependency from the Variable API module, and then I will add the new option.

Anonymous’s picture

Status: Postponed » Patch (to be ported)

I added the option for the priority in the development snapshot. This code needs to be back ported to the Drupal 6 branch.

bperet’s picture

Issue summary: View changes

Was this ever released? If so, where is the option located?

I was trying to use this with the domain access module and it does not work at the default priority of 0 (same as domain access), because the domain grant "available on this domain" ends up true, so the book_access roles and users are ignored. Changing the priority to 2 (like forum_access does) makes it work properly. (If the book isn't available to the user/roles available, then it doesn't matter if it is available on the domain view).

I noticed from the code that the priority comes from a variable, book_access_priority, so I just used SQL to add that to the variables table with a priority of 2:

insert into variable values ('book_access_priority', 'i:2;');

And now it works fine with domain_access. But I did have to go in to each book, click on the Book Access tab, and re-save the values, so it redid the permissions on the child pages. (I first tried "rebuild permissions," but that did not seem to do anything. Works great after re-saving the values.)

joseph.olstad’s picture

Status: Patch (to be ported) » Closed (outdated)

Try the latest 7.x-2.2 version of the book access module.

It works well.