Wednesday, December 28, 2011

subuser and organizational administration

Once subusers were creating, with content profiles creating and editing alongside, I also needed the ability to delete those users that I'd created. 

Administer subusers wasn't enough, since I didn't want my parent users visiting the user administration page - just cause it's one more thing to train them on.

Instead, I added a views field handler to show a delete link, plus I had to customize the access callback to ensure that users don't delete themselves.

All in all, not so bad.  I think I'll contribute that back into the module if I can...

Posted via email from dsayswhat's posterous

virtual_roles module

Just implemented virtual roles module for the first time.  After some initial headache, it works well.

virtual_roles (henceforth: VR) uses contexts (oh no not again, find a new word please) to decide when to trigger some role-related action.  VR ties contexts to role processing, lets you define custom logic for when that role is to be applied, etc.  All very nice.

The key thing about virtual_roles is that it has cache baked in, and it's non-optional.  Contexts are made up of two possible $ops, cache and process...you can turn off caching in the UI, but you still have to provide a cache case in the context, or things won't work as expected.  Be safe: define a cache id in your virtual roles context.

Posted via email from dsayswhat's posterous