We have a project where we are going to be using the Book module to structure Courses (Books), and inside each course will be a series of lessons. We will be using Ubercart to allow users to purchase access to the Courses. Once the user purchases a course, we need to have the proper role automatically assigned, and proper permissions granted through the Book Access module on a per user basis.

After looking at the code in the book_access module, our request is to have the code split into the appropriate number of separate functions with in the book_access_admin_form_submit function. That way we could just call those functions from within our own custom Ubercart module that we need to write so we can tie into the book_access module.

Please let us know if this would be possible, or if you have any additional questions. Thanks.

Comments

Anonymous’s picture

we need to have the proper role automatically assigned, and proper permissions granted through the Book Access module on a per user basis

It's enough to add a new row in the database table used from Book access, and force an update of the node access permissions ( node_access_rebuild()).

Anonymous’s picture

Title: Book Access API? » Book Access API
Version: 6.x-1.0-rc5 » 6.x-2.0-alpha1

I am working on this and #891492: Avoid full node access rebuilding at the same time. I need only to add the Doxygen documentation for the new functions, and to verify if it makes sense to allow third-party modules to alter the behavior of Book access through custom hooks.

Anonymous’s picture

The API is partially implemented; I still have to change the code to use three custom hooks that would allow to third-party modules to alter the access permissions on a book basis.

Anonymous’s picture

Status: Active » Postponed

The module implements now functions that allows to third-party modules to add data to its database tables (see book_access_author_add(), book_access_role_add(), and book_access_user_add()); it uses also three custom hooks to allow third-party modules to alter the grants for a specific book (hook_book_access_author_grants_alter(), hook_book_access_roles_grants_alter(), and hook_book_access_users_grants_alter()).

I am marking this report as postponed, for now; before version 6.x-2.0 is released, I will possibly add more CRUD functions.

Tomorrow morning, I will create a new alpha release for branch 6.x-2.

Anonymous’s picture

The API will probably change before version 6.x-2.0 is out; the API as it is now must be considered temporary.

Anonymous’s picture

Status: Postponed » Fixed

I think there will not be further changes to the API.

Status: Fixed » Closed (fixed)

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