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 Profiles (Moderator: Dave Greenberg) »
  • Limiting access to profiles by Drupal role/CiviCRM group
Pages: [1]

Author Topic: Limiting access to profiles by Drupal role/CiviCRM group  (Read 968 times)

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Limiting access to profiles by Drupal role/CiviCRM group
August 09, 2011, 03:58:11 am
I have a site with a number of CiviCRM profiles set up to be exposed via the user account using the 'View/Edit Drupal user account' setting, but not seen on the user registration page.

On the registration screen the user is enabled to select one or more roles that they wish to adopt on the site, and these are synched to CiviCRM Groups using the roles sync module.

What I want to achieve is a position where only certain of the profiles are visible to the user based on the roles/groups that they have selected at registration. I read that this can done by using CiviCRM's ACLs, in conjunction with the roles sync module. Before I get stuck into this, can anyone confirm that this approach works, and if so, is anyone aware of any useful documentation re: ACLs, as it all seems a bit confusing.

Thanks in advance.
Graham
Graham Mitchell
http://mc3.coop

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: Limiting access to profiles by Drupal role/CiviCRM group
August 09, 2011, 07:51:32 am

1. can u let us know where u read this

2. i think it might be possible, but not sure if anyone has done / used it. This most likely means there will be a few issues / bugs that crop up as u go about doing this

3. U'll need to create civicrm ACL roles for the various roles, and then give them permission for those profiles you want them to access

keep us informed

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

andersiversen

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 1
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.26
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: Limiting access to profiles by Drupal role/CiviCRM group
September 20, 2011, 06:43:55 pm
I have a similar issue - so similar, I think, that I'll reply here:

I have 3 different profiles all with the 'View/Edit Drupal user account' ticked - profile a, b and c.
I also have three different drupal user roles: a, b and c.

All three profiles show up on all of the drupal users own pages (www.example.com/user). Drupal user "a" can only edit profile "a", so permissions are set up correctly in that sense. But I would like to hide profile b and c for users with the role a, on their Drupal user page, because it simply looks very bad - for exampel that a student can see a teacher profile on her user page.

How do I hide the profiles that doesn't match the user role / that the user doesn't have access to edit anyway ?

Cheers and thanks in advance !

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: Limiting access to profiles by Drupal role/CiviCRM group
September 20, 2011, 08:51:29 pm

two comments and questions:

1. can you explain a bit on how u've set it so: Drupal user "a" can only edit profile "a"

2. This came up at an IRC meeting between mrfelton, dgg and me earlier today:

http://irc.civicrm.org/logs/%23civicrm.log.2011-09-20.txt from [16:17] or so

Some code along these lines is here:

http://issues.civicrm.org/jira/browse/CRM-8897

If you have the skills, might be best to collaborate with tom and figure out what will work etc

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

andersiversen

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 1
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.26
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: Limiting access to profiles by Drupal role/CiviCRM group
September 29, 2011, 03:14:09 pm
Uops, my bad, I haven't set anything - the reason user 'a' can only edit profile 'a', is that user a, b and c, are three different contact types.
Thanks for the links and your always quick replies !

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: Limiting access to profiles by Drupal role/CiviCRM group
September 30, 2011, 03:51:33 am
@andersiversen

So, are you able to hide unwanted profiles without custom coding?

I've not got on this in the project I'm working on yet due to delays elsewhere, but i'm about to get back into it next week. Would be great to know if this is do-able out of the box.
Graham Mitchell
http://mc3.coop

andersiversen

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 1
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.26
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: Limiting access to profiles by Drupal role/CiviCRM group
October 03, 2011, 02:30:43 pm
@Upperholme: No, I'm not able to hide them, in the sense that the "tab" or links to edit the profile for 'b' and 'c 'are still visible for user 'a', but user 'a' cannot edit them, because she is a different contact type than 'b' and 'c' (civicrm tells her that when she click the tab/link).

What I want to do is hide them. I would be satiesfied to be able to do it with css, but the tabs and links have no class or id tags, so it's not possible.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Limiting access to profiles by Drupal role/CiviCRM group

This forum was archived on 2017-11-26.