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

API is not respecting check_permissions flag WRT new financial_type ACLs

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.7
    • Fix Version/s: Unscheduled
    • Component/s: None
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      The new Financial Type ACLs impose checks whether or not the 'check_permissions' flag has been passed into the api call.

      The code should be moved from the api to the BAO as we try to avoid adding complexity into the api & put the logic in the BAO where it is used by forms and the api.

      The ACLs should ONLY be imposed when check_permissions = 1 (the php layer defaults to 0 whereas the json layer can ONLY pass 1 in).

      ALSO note that the code should throw an exception rather than call

      return civicrm_api3_create_error('You do not have permission to create this contribution');

      Unfortunately that function cannot be marked as private since it's in utils.php & it's not deprecated (just private) so I don't know how to mark it more clearly to prevent new instances of it - but note elsewhere in the function exceptions are thrown correctly. When throwing the exceptions from the BAO use CRM_Core_Exception.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              eileen Eileen McNaughton
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: