CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • Improvements for civicrm_og_sync admin sync
Pages: [1]

Author Topic: Improvements for civicrm_og_sync admin sync  (Read 956 times)

indigocivi

  • I’m new here
  • *
  • Posts: 4
  • Karma: 1
  • CiviCRM version: 4.5.x
  • CMS version: Drupal (always current)
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Improvements for civicrm_og_sync admin sync
February 11, 2015, 08:38:40 am
Hi,
this forum looks like the right place for a feature request.

Civicrm_og_sync (for Drupal) is a cool little module.

Unfortunately it lacks the ability to sync og administrators to the according civicrm acl group. It only syncs the group node author and it seems, it never removes them.

My suggestion would be to use an og permission check for the is_admin test.

Something like that in hook_og_membership_insert and hook_og_membership_update:
Code: [Select]
$is_admin = og_user_access_entity('administer group', 'node', $gid, $account);
$gid is of course the og group id.
$account ist the user object created with user_load($og_membership->etid).

So if a Drupal User has the og permission to administer members of his organic group, he would also be able to administer contacts of his group in CiviCRM.

There can be many og admins and they can always change, so just syncing the node author is probably not the best way.

Feedback is welcome.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Improvements for civicrm_og_sync admin sync
February 11, 2015, 12:27:41 pm
My vague recollection is that OG synch did put the 'admins' of the OG in to the civi ACL group. I don't have access currently to test this on a site where I expect this to work, but this is what i expect

- you create an OG
- it creates 2 groups in civi, one ACL, one for the OG members
- you add someone to OG, they are added to the Civi og members group
- you add someone as Admin to OG and they get added to the civi ACL group
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

indigocivi

  • I’m new here
  • *
  • Posts: 4
  • Karma: 1
  • CiviCRM version: 4.5.x
  • CMS version: Drupal (always current)
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Improvements for civicrm_og_sync admin sync
February 12, 2015, 02:43:37 am
Hi,
CiviCRM groups (2 per og group, one mailinglist and one ACL) are created and og membership is synced, that's right and it's pretty cool.

Quote
you add someone as Admin to OG and they get added to the civi ACL group

OG Admins are not synced, only the group node author is added to the ACL group.
If one changes the group node author, this user is also added to the ACL group.

My suggestion is to not rely on the node author but check if a a user has a specific permission in his og group with og_user_access_entity().

I solved that for my use case with a custom Drupal module but I would like to see a better admin-sync handling in CiviCRM.
So I decided to post a feature request here.
« Last Edit: February 12, 2015, 02:53:46 am by indigocivi »

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Improvements for civicrm_og_sync admin sync
February 12, 2015, 10:52:37 am
well i am not sure when things changed and i won't be able to check on the site we had this running on for a while.

but if changes in OG or in Civi 4.5 (our site will be on 4.4.x LTS) means this has broken then this is probably one of those itches it would be good if you can scratch yourself.

if you are able to spin up a custom module to resolve this, then can you take a look at the og-civi code and have a go at fixing it for 4.5?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

indigocivi

  • I’m new here
  • *
  • Posts: 4
  • Karma: 1
  • CiviCRM version: 4.5.x
  • CMS version: Drupal (always current)
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Improvements for civicrm_og_sync admin sync
February 12, 2015, 11:54:37 pm
Quote
well i am not sure when things changed and i won't be able to check on the site we had this running on for a while.

I had a look at older civicrm source code on github.
Yes, this module changed significantly, probably because og-7.x-2.x was totally rewritten.
The check for og admin was different before and obviously synced correctly (it was working for you).

So this is not a feature request and actually misplaced in this forum because this functionality was already there in earlier releases, but broke.
I can't believe that there is no issue for that yet in https://issues.civicrm.org/
I'll see what I can do.
« Last Edit: February 13, 2015, 12:01:42 am by indigocivi »

indigocivi

  • I’m new here
  • *
  • Posts: 4
  • Karma: 1
  • CiviCRM version: 4.5.x
  • CMS version: Drupal (always current)
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Improvements for civicrm_og_sync admin sync
February 13, 2015, 05:24:59 am
Here is the new issue:
https://issues.civicrm.org/jira/browse/CRM-15974

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • Improvements for civicrm_og_sync admin sync

This forum was archived on 2017-11-26.