Uploaded image for project: 'CiviVolunteer'
  1. CiviVolunteer
  2. VOL-174

When creating new projects, users lacking access to view the default contacts for the project relationships can't submit the form


    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Labels:
    • Documentation Required?:


      This problem occurs at /civicrm/vol/#/volunteer/manage/0.

      When creating a new volunteer project, the contacts for the project relationships are automatically set to:

      • owner: the logged-in user
      • manager: the logged-in user
      • beneficiary: the logged-in user's employer, or failing that, the domain organization

      These values are retrieved using api.VolunteerUtil.getsupportingdata and used to prepopulate crmEntity widgets on the form that appears at the above URL.

      This works fine for highly privileged users. For less-privileged users, we run into problems with api.Contact.getlist, which is the API call that powers the widget. This manifests in the following ways:

      • if the user does not have "view my contact," her contact record will not appear in the result of the API call, and the Owner and Manager fields will be set to null.
      • if the user does not have permission (either at the CMS level, via ACLs, or via some customization), then neither her employer nor the domain org appear in the result list, and the Beneficiary field will be set to null.

      If the user is allowed to save the form with a null Beneficiary, an error occurs at the API level. I have not tested whether or not errors result from saving with the other relationship fields nulled. As the Beneficiary throws errors if null and the other relationships are used in managing permissions, contact IDs should be required for all three relationships.




            • Assignee:
              tobiaslounsbury Tobias Lounsbury
              pittstains Frank J. Gómez
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: