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

Contact Create API Check Permissions Parameter Not Passed?

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Important
    • Resolution: Done
    • Affects Version/s: 4.7.12
    • Fix Version/s: None
    • Component/s: Core CiviCRM
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding
    • Verified?:
      No

      Description

      Sorry if this seems scattered...

      I am doing this in a custom extension with an anonymous user. I am getting this issue when doing contact create on an existing contact that I am updating.

      When creating the contact I have:
      dupe_check : 1
      check_permission: false

      This works fine and duplicates are checked. I'm pretty sure the only reason it is working is because the $contactID is null.

      HOWEVER
      When updating an existing contact and passing the id it will fail with the error "Permission denied to modify contact record". I have found that the parameter 'check_permissions' value is not being passed to contact.php, while 'check_permission' is.

      The API is actually checking for the parameter 'check_permissions'. Even if I set my parameter to 'check_permissions' the value is always TRUE in the PHP.

      If I change the !empty($params['check_permissions'] to !empty($params['check_permission'] then it will get the value that I pass. I noticed that this was later added for dedupe.

      Is there any reason that check_permissions for create, delete, etc cannot be set as a parameter?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              slgooding Lee Gooding
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: