In this scenario, we will allow portal users to download documents for support cases related to their company from any document location in the CRM. Additionally, portal users who are the primary contact for the support case may upload and delete documents. The content will be placed using the "script" option to allow it to be placed within an entity form.

  1. Create a SharePoint Content record for cases, using the All Document Locations option:

    screenshot

  2. Create a SharePoint Permission record for cases, with Customer Visibility and the Allow Download permission. Under Customer Visibility Properties, set Customer Field Name to "customerid": This will restrict access to the selected permissions to portal users whose contactid or parentcustomerid value equals the case's customerid value.

    screenshot

  3. Create another SharePoint Permission record for cases, with Customer Visibility and the Allow Download permission. Under Customer Visibility Properties, set Customer Field Name to "primarycontactid": This will restrict access to the selected permissions to portal users whose contactid value equals the case's primarycontactid value.

    screenshot

  4. Link the records created above:

  5. Place the SharePoint list in the Custom Javascript field for the desired page:

    screenshot

 

The result will a list of uploaded files for the support case, with the ability to specify which one of multiple document locations you wish to view. The primary contact for the case will be able to upload and delete documents:

However, other contacts belonging to the support case's parent account will only be able to view and download: