I have configured the default permissions for books, however they have no effect. All new books have no permissions set. This is creating a major learning curve and confusion for my site members. Each book must have the permissions edited after posting in order for anyone to see it.

Comments

rooby’s picture

Title: Default Permissions have no effect. » Default permissions have no effect and don't match per book permissions

This is a very major problem.

1. The default settings have no effect, new books don't inherit the defaults.
2. The default settings don't match the settings per book - On book pages you set permissions per role, per user and for the author but on the defaults you set for users, roles and author. Does that mean you can't have different defaults per role or per user but only for all roles or all users. That pretty much defeats the purpose of the module.
3. To make things harder if you have not set any access settings for a book then everyone is denied from selecting that book in the book area of the node edit form - this is because BookAccess::getBookList() only permits books that have records in the book access tables.

So this means you have to manually set book access every time you create a book, which means you can't have users that have access to create books and book pages unless they also have access to administer book access.

That makes this module only useful for a few use cases.

kenjiru’s picture

I've noticed the same problem with the default settings, they are not inherited by the new books. At first, I though I did something wrong, but then I read this post.

The Access type column on the default setting page is very confusing. I don't understand who are the users described by Default authors access, Default roles access, Default users access.

The columns in the per book access page are in a different order than the columns from the default settings page. This is another source of confusion for the users.

thelee’s picture

Assigned: Unassigned » thelee
Priority: Major » Critical
thelee’s picture

Part of this is a legitimate bug (no propagation of defaults), part of it is a documentation ambiguity (defaults for roles/users is simply the default for whenever a role or user is added to a book page, i believe). i'm working on fixing up both.

thelee’s picture

whew ok - these defaults are pretty much completely un-implemented, hence the confusion.

rooby’s picture

whew ok - these defaults are pretty much completely un-implemented, hence the confusion.

Yeah, the current 7 version is a very unfinished port.

thelee’s picture

Version: 7.x-2.0-alpha4 » 7.x-2.x-dev
Status: Active » Fixed
StatusFileSize
new12.59 KB

This is the patch (and matching test cases) that I'm going to be using for this fix.

One thing to note - I have no method to enable per-user defaults and still maintain a semi-decent UX, especially for large sites. So, the only "defaults" that can be enabled are for authors and for each role created on a site.

Defaults will _only_ apply to newly created books. If people are pulling in from the dev branch, then after a couple days of this patch if you install it, it will NOT affect any existing books. You should also make sure to _set_ the defaults, though the changes in this patch defaults the defaults (heh) to giving administrator roles full access, authors full access minus change access permissions, and everyone else view access.

I will eventually set up a change to let you either revert a book to the defaults OR revert _all_ books to the defaults, but I'll have to create a separate issue for that because I don't think it's a stable release blocker.

thelee’s picture

Status: Fixed » Active

ah scratch that optimism above. i just found a bug with my changes, moving back to "active" until i get that fixed.

thelee’s picture

alright, this is the revised patch that i'm going to use. for the curious, scroll to the bottom to see the new test cases (caseAuthorVsAdminDefaults and caseDefaultsPropagateToNewNode) for a technical explanation of how the patch works.

My earlier comments from #7 still apply -- i've just fixed the bug in that patch with the patch in this post. To re-iterate, since it's important: defaults will only apply to newly-created books.

thelee’s picture

Status: Active » Fixed

patch has been pushed to 7.x-2.x git branch

thelee’s picture

I've created a new related issue: http://drupal.org/node/1852070

As mentioned in the related issue, it's not a critical bug fix, simply missing functionality, but I leave it here for any interested party to cross-reference.

Zippy’s picture

Hi,
thank you very much for maintaining this project. I appreciate your hard work!
I installed the newest dev version of November 28, 2012 but I still encountered some bugs on the default permission page (/admin/content/book/settings).
When I configure the default access settings I cannot save all fields properly. The 'view book' permission is granted notoriously to every role available.
The author's default permissions seem to be granted correctly, but on the book's individual 'book access'-page these permissions aren't available.

regards

thelee’s picture

Status: Fixed » Needs work

Hi again - could you talk a bit more specifically about the issue? Unfortunately, my project time (20% of my work time) is already capped until December begins, so I won't be able to get on it right away, but I am watching the issues.

"View Book" is enabled by default explicitly now because that's how it effectively functioned in the past, at least by my experiences (i.e. everyone could view book pages until a book manually had its access changed). Are you saying that when you un-check "view book" it doesn't go away?

Zippy’s picture

Hi,

maybe it works as intended.
I cannot unset (and successfully save) the 'view book' permission within the default book access settings but I am able to edit the 'view this book' permission for a particular book. In my eyes the behavior of the default access permissions is a little inconsistent because I would expect all my changes to be saved.

kind regards

thelee’s picture

Hi Sven, taking a look at it now

thelee’s picture

Alright, it's a bug with how i'm setting the defaults for role - am not checking to make sure the role doesn't intentionally have defaults cleared. working on a test case and fix.

thelee’s picture

Status: Needs work » Fixed
StatusFileSize
new2.58 KB

Alright, I've used this patch and pushed it to the 7.x-2.x branch, should show up in drupal.org in a day or so.

Zippy’s picture

Hi,
everything seems to work fine now! Thank you very much for your hard work!

Status: Fixed » Closed (fixed)

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