As it stands the module contains code for the Book Page Access module to allow users delegated using that module access rights to domain pages. The code is conditional on a patch i had posted to the BPA issue queue a couple of months ago.

As the patch shows no signs of getting committed, i plan to remove all references to that module within that code and turn it into a generic hook to allow external modules to utilise Domain Admin features

while we're at it, we can also put out an API.php file to illustrate domain_admin hooks

Comments

ergonlogic’s picture

Sounds great, nirbhasa!

nirbhasa’s picture

Ok, so the latest dev has a first attempt at this - all references to the external module are removed and now delegation within the domain is handled by a generic hook_domainadmin_delegate. Needs a good bit more testing, but we're getting there :)

nirbhasa’s picture

Ok, I've been looking at this a bit more, and I made a few changes which will serve to make this whole delegation thing less obtrusive for those who don't want it, and also make the whole permission handling a bit more elegant:

  • The delegation hook is now hook_domainadmin_delegate($node, $perm) so you can delegate certain perms and not others
  • Instead of calling the delegation function all the time for node based permissions (eg Publishing checkboxes/ authoring/ rearranging child pages), I now have a domain_admin_node_access which checks if the user has domain_admin_access for the domain, or failing that been delegated to that node.
  • I noticed we were always checking if the user was in the domain at the same time as we were calling domain_admin_access, so I placed the check inside. I also widened domain_admin_access to check if the users had access to any given domain, with the current domain as default (good for settings pages etc). This meant we could simplify the various menu access callbacks.

The above changes sound more radical than they are, but before I make a commit, Im just wondering does the above constitute an API change, and what the situation is then? Personally I'm inclined to commit it to the 1.x branch as before, and release a 1.0 beta version. (we could still have the 0.5 as recommended for the moment) But I'm happy to listen to more experienced and wiser voices :)

nirbhasa’s picture

hook is now in d6 and d7 dev

nirbhasa’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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