This documentation relates to CiviCRM version 3.2. It's not maintained anymore.
Current version of documentation.

Create Group with ACL Permissions

Skip to end of metadata
Go to start of metadata

This page refers to outdated version of CiviCRM. Check current version of documentation.


Documentation Search


CiviCRM 3.2 Documentation

Support and Participation

Developer Resources


CiviCRM book!

Make sure to check out Understanding CiviCRM as well! You can also support this project by ordering a hard copy.

Though it has been tested and is believed to be safe, this code was written by a  non-professional & inexperienced programmer. Use at your own Risk.

 I created this script to allow ACL-limited users to create groups while automatically creating the necessary ACL role, permission, and assignment in order to allow that user to actually use the group they just created. (Strangely, the existing 'Edit User Groups' Drupal permission doesn't ensure this.)

 You will almost certainly need to modify the first require_once() to specify the path to your own settings file.

Note that the code that generates the multi-select (which allows the user to specify what groups should have permission to view this group being created) is written specific to only include groups with have the case insensitive string 'staff'in the title. You may want to modify or eliminate this. Look for the foreach block which includes:

This was created & tested on:

  • PHP 4.3.11
  • MySQL 4.1.20
  • Drupal 5.1
  • CiviCRM 1.7.9397

It is intended to be run in a Drupal block. You'll want to limit it to a special Drupal Role to have any sense of security. 

Thanks to Donald Lobo for help with this, but any errors are solely mine. Corrections & Improvements are welcomed.

    - Matt [at] NinjitsuHosting [dot] com 

Labels
  • None

Creative Commons License
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 United States Licence.