Getting WordPress to see your UW Groups
An item that’s been on a lot of wishlists of a lot of people for a long time now is the ability to have WordPress and the UW Groups Service communicate with each other. Most of my own pursuit of the issue revolved about using the groups REST API to pull in user data in an asynchronous manner from a WordPress trigger, or otherwise using a lot of convoluted logic to something that would be rather simple.
Recently I’ve been shifting my thoughts to leveraging Shibboleth for this task: shib can release gws_groups a user is a member of automatically upon login, and we can then use this data in WordPress to do various things. As a way to throw my thoughts together and get some sort of proof-of-concept flowing around, I gathered together some PHP and produced this very early plugin for WordPress. Right now it can’t do much, but it can, upon user login, get their gws_group membership under the u_nikky stem, store it in their usermeta information, and show a user’s groups when viewing their profile page.
The question is what do we want to do with this capability? I’ve thought of a few different options, but I’m curious if others have opinions or ideas that I haven’t thought of yet. So far the main contenders seem to be:
Use Groups to Limit Page/Blog Access
Leverage groups to limit access to your blog or specific pages on your blog. E.g.: you restrict your blog to members of u_blogs_nikky_access. Anyone not on this list would be denied access.
Use Groups to assign user roles
Leverage groups by mapping them to specific WordPress user roles. E.g.: all members of u_blogs_nikky_editors are automatically given the highest-level that their groups entitle them to.
Using the Plugin
I really wouldn’t recommend it, but if you wanted to try the plugin and have a box that’s running (or could run) shibboleth, shoot me an email or leave a comment and I’ll document the steps needed to get it running.