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) »
  • Logged in user cannot edit own profile (via social network login)
Pages: [1]

Author Topic: Logged in user cannot edit own profile (via social network login)  (Read 1024 times)

bsetzer

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.x
  • MySQL version: Not sure
  • PHP version: Not sure
Logged in user cannot edit own profile (via social network login)
March 31, 2015, 07:31:53 am
Apologies if this is in the wrong forum topic. Pulling my hair out on this...

Civi install 4.5.5
Drupal 7.34
User login: using "OneAll" social login module
Also using Civi RealName module for name display

Here's the scenario

1. User creates new account using either Facebook or Google (the new user is automatically assigned a unique role that has view/edit permissions for Civi contact).
2. Viewing "my account" user can go in and add contact details (name and address).
3. Everything is fine if I remain logged in this *first* time.
4. Once the user logs out and logs back in (with the same social network as before), they no longer can access their contact in My Account - either to view or edit. User receives a "you do not have permission to edit this contact record"

I have also tested with creating a user by hand in Drupal and assigning the same role. *This* user is able to view/edit the contact information.

I have reviewed the info here: http://book.civicrm.org/user/current/initial-set-up/permissions-and-access-control/ and all of the steps described for setting up user access are identical to mine.

Any assistance from the group is most appreciated!

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: Logged in user cannot edit own profile (via social network login)
March 31, 2015, 12:33:53 pm
Hi - trying to understand but not quite getting it  ??? so offering a multi-choice interpretation in the hope that your answer will add something I am missing

So the user gets logged in the first time with Role X and can do the required due to Permissions granted to Role X

Second time user logs in, they ...

- do get assigned  Role X but cannot do the required

- get assigned a different Role Y that does not have the permissions needed

Other things to confirm

- does the Drupal user get linked to their civicrm record via the uf_match table

- does the Drupal /user page have a link to 'View contacts record'

- does the Civi contact page have the drupal id near the top right of the contacts details which you can click back through to their drupal user record?

(just trying to confirm the basics here)

- something else?
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

bsetzer

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.x
  • MySQL version: Not sure
  • PHP version: Not sure
Re: Logged in user cannot edit own profile (via social network login)
March 31, 2015, 01:31:12 pm
Thanks for the reply - sorry if I was too vague in my original post. Some answers to your assumptions:

So the user gets logged in the first time with Role X and can do the required due to Permissions granted to Role X
> CORRECT

Second time user logs in, they ...
- do get assigned Role X but cannot do the required
> CORRECT - they log in and remain the same role as when the account is first created.

- get assigned a different Role Y that does not have the permissions needed
> INCORRECT - see above. Logged in user retains original role assigned.

Other things to confirm
- does the Drupal user get linked to their civicrm record via the uf_match table
> NOT SURE - I will check.

- does the Drupal /user page have a link to 'View contacts record'
> NO - there is a profile form called "Name and Address" on the /user page. The link to go to this form and the data is no longer visible the second time the user logs in. See attached. This role has permissions for profile listings and forms, profile listings, profile edit, profile view...

- does the Civi contact page have the drupal id near the top right of the contacts details which you can click back through to their drupal user record?
> YES - and the Drupal ID is consistent to what I see when the user logs in.

Let me know if I can provide any more details... perhaps there is some setting in the profile itself that is wonky?

Thanks!


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: Logged in user cannot edit own profile (via social network login)
April 01, 2015, 01:13:59 pm
and the second time they login it is definitely the same Drupal user id they use?
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

bsetzer

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.x
  • MySQL version: Not sure
  • PHP version: Not sure
Re: Logged in user cannot edit own profile (via social network login)
April 01, 2015, 01:28:10 pm
Yes, 100% positive. The Drupal ID and the CiviCRM ID remain the same as when the account is first created.

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: Logged in user cannot edit own profile (via social network login)
April 01, 2015, 11:27:58 pm
sounds like a real brain teaser - something must be happening on second visit that is wiping settings
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

bsetzer

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.x
  • MySQL version: Not sure
  • PHP version: Not sure
Re: Logged in user cannot edit own profile (via social network login)
April 02, 2015, 06:18:07 am
My only guess is it's something with the profile form created in CiviCRM and attached to the Drupal user account. The following are checked under "used for":

Standalone Form or Directory
Search Views
Drupal User Registration
View/Edit Drupal User Account

If you have any suggestions on where to look to check other access settings, let me know. One other note - if I change the role setting in Drupal to allow the role to "view all contacts" and "edit all contacts" (which I know is not something I want to do), the profile re-appears. But if I try to edit it, I get an error:

Warning: in_array() expects parameter 2 to be array, null given in CRM_Profile_Form->buildQuickForm() (line 711 of /home/robonati/public_html/sites/all/modules/civicrm/CRM/Profile/Form.php).

Thanks!

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: Logged in user cannot edit own profile (via social network login)
April 02, 2015, 12:18:12 pm
Why have them checked for all those options? Do you really want that profile to be a Search View.

Try setting the profile so it is used only for Drupal User Registration and View/Edit.
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

bsetzer

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.x
  • MySQL version: Not sure
  • PHP version: Not sure
Re: Logged in user cannot edit own profile (via social network login)
April 02, 2015, 01:56:31 pm
"Search View" actually was NOT checked - sorry about that. I have also unchecked "Standalone Form"... did not seem to make a difference with the issue.

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: Logged in user cannot edit own profile (via social network login)
April 02, 2015, 08:14:19 pm
sorry but i don't see how to help. in summary you are saying

user gets logged in with new account - gets correct role - can edit civi name etc
user logs out
user logs in again - gets same correct role - cannot edit civi name

i would assume that once they are 'in' drupal, then either they have the role (and hence the permission) or they don't have the role (and hence won't have the permission)

if i understand you right you are saying they have the role but not the permission. that seems to defy some very very basic drupal concepts.
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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Logged in user cannot edit own profile (via social network login)

This forum was archived on 2017-11-26.