Uploaded image for project: 'Extensions'
  1. Extensions
  2. EXT-65

financial type access control adds too restrictive join

    Details

    • Type: Task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Labels:
      None

      Description

      likely related to CRM-19520.

      when FT access control is enabled, reports that include the civicrm_contribution table are run through CRM_Report_Form::getPermissionedFTQuery(). that function builds a temp table with the contribution ID for all contribs the user should be permitted to view based on what FTs their role allows. it then adds that temp table as an INNER JOIN to the main report query.

      the problem is that in some cases that behavior is too restrictive. for example, in the membership summary report if you have memberships that do not have any contribution attached to them (a free membership), they are excluded from the report because they fail this inner join.

      I played with turning that into a LEFT JOIN but it hosed the membership summary report on a DB with ~300k contributions (and a pretty robust server).

      I'm thinking the strategy might be to structure that temp table so that it includes all fields from the civicrm_contribution table (it currently only includes the id) and then replace the civicrm_contribution with the temp table in the FROM clause. the table is aliased and should always be referenced by the alias in the select and where clauses, so that might work.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              lcdweb Brian Shaughnessy
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: