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
Comment #1
Anonymous (not verified) commentedIt'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()).
Comment #3
Anonymous (not verified) commentedI 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.
Comment #4
Anonymous (not verified) commentedThe 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.
Comment #5
Anonymous (not verified) commentedThe 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(), andbook_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(), andhook_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.
Comment #6
Anonymous (not verified) commentedThe API will probably change before version 6.x-2.0 is out; the API as it is now must be considered temporary.
Comment #7
Anonymous (not verified) commentedI think there will not be further changes to the API.