Drush plugin to sync CiviCRM (Smart) Groups to ACL groups
- Put it in ~/.drush or anywhere else Drush looks for commands (/usr/drush/commands etc.)
- Use drush cc drush to clear the local command cache.
- Use the --test and --print options to test and see the output
- Do "drush civigroup-sync fromID toID" or "drush civigroup-merge fromID toID" to sync 2 groups
- Schedule a cron job if you want to sync Smart groups to ACL groups
Source Group 1: User 1, 2, 3 Source Group 2: User 2, 3, 4 Action Sync to Group 5 Result: User 1, 2, 3, 4 -> Group 5
This script works for me but is largely untested. It should work as intended but there may be instances where it doesn't work properly. Use this on a dev system first and make a backup of your system before using it.Source Group 1: User 1, 2 Source Group 2: User 2, 4 Target Group 5: User 2, 3, 6 Target Group 6: User 2, 6, 7 Action Merge to Group 5, 6 Result: Group 5: User 1, 2, 3, 4, 6 Group 6: User 1, 2, 4, 6, 7