Adding role permissions to CiviCRM profiles
Profiles can be used to collect and expose data from CiviCRM. One common scenario is to display a membership directory. Recently, one of our clients wanted to use several different profiles to present different aspects of their membership directory based on groups, tags and a few custom fields. However, we wanted to restrict who could access those directories.
A few years ago, we did something similar using a theming function in Drupal. It works fine, but not really optimal since it's tied to the theme and it's not easy for the client to update as they add new profiles. The Linking Profiles wiki also outlines a way to use CiviCRM hooks.
We took this idea one step further and turned it into a Drupal module: CiviCRM Profile Permissions. Once installed, the permissions for each public profile can be restricted by role at admin/settings/civicrm_profile_permissions.
http://drupal.org/sandbox/dharmatech/1142650
Feel free to leave a comment or tweet if you find this module useful.
We often write "throw-away" code for one-off tasks or to scratch our own itch. The source might not be immediately useful for others but the lessons learned are invaluable. We always try to blog, tweet, or share those lessons when appropriate.
- Avalanche Forecast
- Breakout in Processing
- Brewfest Mobile App
- CiviCRM Discount
- CiviCRM Profile Permissions
- Danger Rose Field
- DB Tools
- Image Node Reference
- Linode Drupal StackScript
- Liquid Planner Shell
- OpenVZ Drupal Installer
- Randstring Safari Extension
- RSRA Database
- Ubercart/CiviCRM Integration
- User Login Block
- Webform Download Archive
In the process of writing custom software for our clients, we've also contributed bug fixes, patches, unit tests and documentation to various open source projects.



Comments
Contribute on d.o?
Will you be adding this to contrib at drupal.org?
If the community needs it
We're happy to keep this at d.o if there's a need. It didn't seem necessary since there's little room for added features with this module. We also didn't want to add a module that doesn't have a clear path going forward. It provides a great function at the moment, but this could easily get pulled into core.
Thanks for the comment fathershawn.
d.o.
This module now lives in the sandbox on d.o. We will consider promoting as a full project if we get folks using it.
Post new comment