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) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • A basic scenario: ungrouped contacts and ACL
Pages: [1]

Author Topic: A basic scenario: ungrouped contacts and ACL  (Read 585 times)

useruseruser

  • Guest
A basic scenario: ungrouped contacts and ACL
November 17, 2011, 10:38:09 am
Hi,
I am using CiviCRM latest stable on Drupal 7.

I want to achieve the following scenario using ACL:

-All registered users can edit all contacts EXCEPT contacts in group E.
-Group E is only accessible by a subset S of all registered users

This seems like a very basic setup, and after reading about it from your documentation and forum, there seems not be any easy solution? I hope I am wrong.


Bear in mind that I mean all contacts in my scenario, even UNGROUPED ones. I face several problems trying to implement ACL if there are ungrouped contacts. To me it seems you can't set any ACL properties for ungrouped contacts.

Ungrouped contacts are easily made, for instance if user accidentally forgets to assign group. Also, if user enters company information in "add new individual", then CiviCRM automatically creates an organization without a group.

Adding a smart group to be included in ACL that include non grouped contacts did not work, I received DB errors and odd navigation menu related behavior.

What would be the easiest way to do this? Adding own profile, where groups are always assigned? Or do I have to code my own hookups to force grouping?
« Last Edit: November 17, 2011, 10:44:37 am by useruseruser »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: A basic scenario: ungrouped contacts and ACL
November 17, 2011, 10:59:14 am

You will need to use ACL hooks to do so. AN example of this is here:

http://svn.civicrm.org/hrd/trunk/drupal/hrd.module

The contacts in HRD_SECURE_GROUP_ID are not exposed to anyone except for people with the drupal permission:

access secure contacts

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

useruseruser

  • Guest
Re: A basic scenario: ungrouped contacts and ACL
November 23, 2011, 06:41:23 am
Thanks for the reply!

We talked about this in IRC, and I decided to add own hooks to add default group for newly added contacts.

However, I found out that in multi-site installation, there is a possibility to add default group for new contacts. So my question is as follows: could I just edit the civiCRM settings file and enable multi-site even if I currently have only one site? This way I could easily have default group for new contacts.

In the multi-site installation document it states that "do not go to any url before enabling multi-site in settings". So should multi-site be enabled only on fresh new civiCRM installations or can I just turn it on even if I have used my site as non multi-site?

I have to add own hook even if using multi-site. It seems no default grouping is added for automatically created organizations (like, when creating a new individual and I enter company information).

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: A basic scenario: ungrouped contacts and ACL
November 23, 2011, 02:26:54 pm

You can potentially do that, but i suspect you are making your install a lot more complex than needed, IMO

I think u can turn it on later, but u'll need to assign current contacts to the right org group etc. I dont do a lot of multi-site stuff, so dont remember the finer details

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: A basic scenario: ungrouped contacts and ACL
November 23, 2011, 02:56:50 pm
Quote
I think u can turn it on later

Yes, you can. Although it won't retrospectively group contacts.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • A basic scenario: ungrouped contacts and ACL

This forum was archived on 2017-11-26.