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) »
  • grant view+edit permissions for a smart group (only)
Pages: [1]

Author Topic: grant view+edit permissions for a smart group (only)  (Read 1181 times)

julianbrelsford

  • I’m new here
  • *
  • Posts: 28
  • Karma: 2
grant view+edit permissions for a smart group (only)
October 22, 2009, 09:36:56 am
When it comes to permissions, we (Philadelphia Yearly Meeting) want the ability to do some pretty complicated stuff. Seems like CiviCRM is really intended to do what we want, but it has me stumped on one thing.

I created a smart group consisting of one of the ~100 congregations our organization serves. Then I created an ACL, an ACL Role, a Group that has this ACL role, and a user as a member of this group. On the ACL screen, the "Operation" (action permitted) is set to "edit".

If I then log in as the test user who's part of this group, I get access to view all of the members of the relevant congregation ("congregation1"). And I get an "edit" button when viewing these records.

But if I click the "edit" button, I get the message, "Access denied // You are not authorized to access this page."

(If I (as CiviCRM administrator) change the ACL to allow view only, the edit button that wasn't working anyway, disappears.)

How can I make it so that this test user has the ability to edit records of people who are in "congregation1's" smart group?

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: grant view+edit permissions for a smart group (only)
October 22, 2009, 10:12:53 am

if u have 100 congregations, i'd encourage you to think about using acl hooks, might be much more scalable and efficient than the UI based ACL implementation.

http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmaclWhereClause

can u give the user permission to "add contacts". this is a wierd issue with the edit permissioning which we need to fix


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

julianbrelsford

  • I’m new here
  • *
  • Posts: 28
  • Karma: 2
Re: grant view+edit permissions for a smart group (only)
October 22, 2009, 01:14:30 pm
Your suggestion of giving "add new contact" access to the test user worked, although it's problematic in its own way.

I'm interested in learning how to change the behavior of CiviCRM by using ACL hooks, but I'm not quite sure how to get started.

Thanks for your help so far!

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: grant view+edit permissions for a smart group (only)
October 22, 2009, 02:14:30 pm

1. can u elaborate on how it is problematic

2. check drupal/civitest.module.sample

3. also check the various blog entries where we explain different hooks

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

idmacdonald

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 1
Re: grant view+edit permissions for a smart group (only)
November 03, 2009, 07:32:54 am
Hi,

I just ran into this same issue. Giving the user role 'Add contacts' permission has fixed the 'access denied' problem when trying to edit the contact. However, I don't actually want this user role to be able to create new contacts, only edit certain existing ones. Is there any way to do this?

I'm already using hook_civicrm_aclWhereClause to implement some custom permissions.

-Ian

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: grant view+edit permissions for a smart group (only)
November 03, 2009, 07:57:50 am

currently no easy way around it. if important to you consider contributing a patch to fix this issue. i dont think it should be too involved

ping us on irc if u need help getting started

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • grant view+edit permissions for a smart group (only)

This forum was archived on 2017-11-26.