Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-13091

api chaining broken on rest (permission issue)

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.3.5
    • Fix Version/s: 4.3.6
    • Component/s: None
    • Labels:
      None

      Description

      Been banging my head on a tricky one: I'm using the rest interface with the api_key of user 1, so I'm sure he has all the permissions needed.

      I'm creating a contact with related entities (phone+addresses). The contact is properly created, but the related address isn't and I get a:

      "Error in call to address_create : API permission check failed for address/create call; missing permission: access CiviCRM."

      So it seems that the the current user is lost somewhere. When looking at the account->uid in user_access, it indeed seems to revert to user 0 somewhere between the contact creation and the related entity creation.

      I tried to chain other apis and start with a different one that contact.create, when I chain phone.create as the main call and api.address.create it works! (I know it doens't make sense to chain these, but wanted to try)

      I'm running low on ideas, someone got a suggestion?

      P.S It's a regression from "not too long ago" (I'm sure it worked on 4.2), probably when we introduced better bootstrapping and acl in the api.

      X+

        Attachments

          Activity

            People

            • Assignee:
              xavier xavier dutoit
              Reporter:
              xavier xavier dutoit
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: