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) »
  • Restricting access question
Pages: [1]

Author Topic: Restricting access question  (Read 543 times)

clarkac

  • Administrator
  • Ask me questions
  • *****
  • Posts: 399
  • Karma: 11
  • CiviCRM version: 4.4.11 & 4.5.5
  • CMS version: Drupal 7
  • MySQL version: 5.1.61-cll
  • PHP version: 5.3.27
Restricting access question
March 25, 2014, 10:03:39 am
One of my clients would like access to a custom field restricted, so that some users can edit and other users can only view.  Is this possible with Civi's access features?  I'm not sure that it is - your advice will be appreciated!  This is using Drupal 7, by the way, and Civi 4.4.3
Andy Clark

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: Restricting access question
March 25, 2014, 11:09:59 am

you can do access control on custom groups (i.e. at group level bbut not at the field level)

depending on what exactly u need, doing it via a hook might be a bit simpler (but might require a lot more php coding skills)

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

clarkac

  • Administrator
  • Ask me questions
  • *****
  • Posts: 399
  • Karma: 11
  • CiviCRM version: 4.4.11 & 4.5.5
  • CMS version: Drupal 7
  • MySQL version: 5.1.61-cll
  • PHP version: 5.3.27
Re: Restricting access question
March 25, 2014, 11:28:55 am
Thanks, Lobo.  So I could create a smart group based on this custom field and then control access through that group?
Andy Clark

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: Restricting access question
March 25, 2014, 01:26:09 pm

the groups of folks who have edit access vs view access vs no access is not really tied into the custom field value at all

might want to read the book chapter on ACL's. Its a bit complicated to set up but seems to do an ok job of controlling access

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

clarkac

  • Administrator
  • Ask me questions
  • *****
  • Posts: 399
  • Karma: 11
  • CiviCRM version: 4.4.11 & 4.5.5
  • CMS version: Drupal 7
  • MySQL version: 5.1.61-cll
  • PHP version: 5.3.27
Re: Restricting access question
March 28, 2014, 07:33:05 am
I dug into this, and couldn't get it to work.  Then I noticed these words on the ACL screen which explain why:

NOTE: For Custom Data ACLs, the 'View' and 'Edit' operations currently do the same thing. Either option grants the right to view AND / OR edit custom data fields (in all groups, or in a specific custom data group). Neither option grants access to administration of custom data fields.

So, in fact I can't restrict access to custom data since the only valid options are View & Edit and they are both the same?  Is that right?  If so, then there is effectively no ACL functionality for custom data at present...  Disappointing...
« Last Edit: March 28, 2014, 07:51:24 am by clarkac »
Andy Clark

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: Restricting access question
March 28, 2014, 08:48:09 am

argh

i suspect thats because the code was written in Civi v1.x and has not been revisited (nor has it been a big issue on the forums)

as with any software, adding that feature is just a question of time and/or money. if your client can afford to sponsor it, that would be great

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) »
  • Restricting access question

This forum was archived on 2017-11-26.