How To: Enable Collaboration
This guide describe how to enable collaboration for a table/entity on the portal.
This guide describe how to enable collaboration for a table/entity on the portal. It is intended for administrators of the klevr_portal and CE.
This guide assumes that you have sufficient knowledge and experiecne with CE system customisation and Klevr Portal Configuration. Please read the entire guide as least once before picking sections to follow as there are tips and alternatives in various parts of the text where they are relevant.
Purpose
From time to time custoemrs may have a requirement to allow their portal users to work together on a record in the portal, for instance a request or a grant application. Sometimes the requirement would be to allow users of a group to work on each others records, for instance all users belonging to the same company can see each others cases on the portal, and this can be achieved with standard configuration. The need for collaboration comes in when there is no logical grouping between the users, and it is a select subset of records that they want to share or collaborate on, for instance I want to give my project team access to one of my grant applications but not the others. This is where collaboration can come in handy to give specific permissions to a specific record to a specific user.
It is important to note that there are a lot of steps and configuration required to allow collaboration to work. Each part can further be configured or fine tuned for your specific scenario. The steps here outline a generic approach and more advanced options are pointed out, but is not a complete list, and the possibilities are only limited by your creativity.
Detailed Instructions
Here is a summary of what we will be covering:
The first thing you need to do is the required CE configuration. For collaboration to be applied to a record, you need to link the klevr_collaboration record to your table. The Collaborator entity has a polymorphic "klevr_regardingid" lookup, and you can add more tables to this polymorphic lookup by using the klevr_polyeditor.html web resource. Navigate to https://<your environment>/webresources/klevr_oplyeditor.html, find the entity and field, and add a new relationship to your desired table. Remember to add this field and the relationship to your solution for easy promotion through your environments.
Next step is to configure the Portal Table Permissions for collaboration. the queries provider here is to get you started, but you are free to modify the filters, roles and relationships as you see fit. Keep the following permission requirements in mind:
- The owner of the record should typically have access to create, modify and delete collaboration records associated to his record. (Unless collaboration access is given by some other process like backoffice or a fancy flow)
- The person on the receiving end of the collaboration record only needs read access to the collaboration record, even if he needs to be able to write to the related record, so that he cannot change his collaboration record to elevate his permissions.
- The Table/Entity being shared needs to have permissions granted to collaborators. If you want to use both read and update capabilities, you will need 1 permission for each.
For our basic setup we will create the following permissions as per the table below. All permssions in our example would have the role of authenticated, but you could further fine tune the roles for your implementation as required:
| Name | Collaborator - Owner | Collaborator - Read Only | Collaborator - Read Write | MyCustomEntity - Collaborator Read | MyCustomEntity - Collaborator Read Write |
|---|---|---|---|---|---|
| Filter | <condition attribute="klevr_portalcreatedbyid" operator="eq" value="@self" /> | <filter type="and"><condition attribute="klevr_contactid" operator="eq" value="@self" /> <condition attribute="klevr_permission" operator="eq" value="0" /> <condition attribute="statuscode" operator="eq" value="1" /> <filter type="or"> <condition attribute="klevr_expirydate" operator="next-x-years" value="100" /> <condition attribute="klevr_expirydate" operator="null" /> </filter> </filter> | <filter type="and"><condition attribute="klevr_contactid" operator="eq" value="@self" /> <condition attribute="klevr_permission" operator="eq" value="1" /> <condition attribute="statuscode" operator="eq" value="1" /> <filter type="or"> <condition attribute="klevr_expirydate" operator="next-x-years" value="100" /> <condition attribute="klevr_expirydate" operator="null" /> </filter> </filter> | ||
| Parent Permission | - | - | - | Collaborator - Read Only | Collaborator - Read Write |
| Permission Relationship | - | - | - | klevr_collaborator_my_customentity | klevr_collaborator_my_customentity |
| Permissions | CRUD | R | R | R | RU |
| Description | This allows a user to create, modify and delete collaborators on his record. | This allows a collaborator to read a collaboration record assigned to him that is active, grants read access and has either a blank expiry date or an expiry date in the future. | This allows a collaborator to read a collaboration record assigned to him that is active, grants read access and has either a blank expiry date or an expiry date in the future. He only needs read access to this, as it is the associated record that we will grant read/write permissions to. | Replace MyCustomEntity with the tbale name you are enabling collaboration for. Select the relationship that you created in the poly editor between your entity and the collaborator entity. | Replace MyCustomEntity with the tbale name you are enabling collaboration for. Select the relationship that you created in the poly editor between your entity and the collaborator entity. |
If you only want to use read access, you can skip creating the 2 Read Write roles, and vise versa. You could also remove the filter on the permission field if you don't need it. If you want to allow collaboration on multiple entities, you only need to add more MyCustomTable roles, and link them to the same parent, but select the correct poly lookup relationship for that table.
You can further restrict access based on state, publishing state, or any other filter criteria you may wish to add to the permissions.
The next step is to configure your pages to enable collaboration. We will need the following components
- Collaboration subgrid on the record you want to allow collaboration on
- Collaborator Create / Edit page
- Optionally a page for collaborators to see the record through - Not coverfed here, but can be used to limit access to certain fields on the main record if required.
On the main Dynamics Form page for the target entity, add a subgrid to show collaboration records. The Fetchxml should be similar to this:
<fetch distinct="true">
<entity name="klevr_collaborator">
<attribute name="klevr_name" klevr_name="Collaboration Name" />
<attribute name="klevr_contactid" klevr_name="Contact" />
<attribute name="klevr_permission" klevr_name="Access Level" />
<filter type="and">
<condition attribute="klevr_regardingid" operator="eq" value="@currentrecord" />
</filter>
</entity>
</fetch>
The columns you add depends on what functionality in collaboration you want to use. for instance, you could use the conflict of interest fields in your process, or you could use the email address field. You might only use one access level, in which case you don't need to show this. Typically the filter would only be for the regarding record. The rest is handled by the table permission filters.
The subgrid will allow the owner to create new record or to delete existing records to manage the level of collaboration they want on their record. The subgrid should link the create and edit links to the url of the form created below.
Next up we need a form for the user to create, edit and delete the collaborators on his record. Create a new Dynamics Form 2.0 page on the portal, and populate the details as required. The entity schema name should be klevr_collaborator, and the fields really deplend on what functionality you want to use in the collaboration. For instance, do you want to allow the user to select read only or read/write, or will you only have 1 option (e.g. read/write) for all scenarios. Do you want to use an Expiry date feature, or just make it open ended and use the status of the record to terminate collaboration. And then, most importantly, are your collaborators existing users on the portal, and part of a group that the owner can see already (e.g. I want a colleague in my organisation to collaborate on a record), or would they either not be on the portal yet, or not part of a group that the user have direct access to. For the formar, you can simply use a lookup to the invited contact field and set the subgrid with the correct query to select an existing contact. For the latter, you should display the emailaddress field, but then you would also need to write a flow to create a portal invite and send it to the target email and then set the contact record on invite redemption.
Lastly, you could optionally create a different form for the colloaborators to work on the reocrd, but you would need to use roles, or different views and detail pages etc, or generate a hyperlink to a specific edit page for the record in a flow on collaborator record create for a collaborator to access the record through a specific page.
The final bit is the conflict of Interest process. This is not particularly covered by our scenario, but the following advice applies. You may need another page to show some basic or summary info for the record in question in order for the collaborator to determine if they have a confilct or not, before getting stuck in. The collaborator record it self has a conflict response field and a conflict status that you can use to drive the process.
Security and Privacy Considerations
It is important to ensure the table permissions are configured correctly. The collaborator should not have access to modify the collaboration records where they are the collaborator. An owner of a collaboration record can modify the collaborator record in order to grant more or revoke access as required. Ensure you understand the difference between these 2 relationship fields on the entity to ensure the configration is correct. The samples above gives you the starting point.
Even though there is a collaborator read write permission, the read write ability is on the record being collaborated on, and not on the collaboration record. Therefore the permission that is linked to the entity being shared is the one that gets the read write permissions, with a parent permission of the collaborator record, through the regarding poly lookup. The filters provided in the sample above takes care of a blank or future expiry date, but can be removed if you do not use expiry dates in order to optimise the query and performance. Other filters can be added as required, especially on the related entity where you might want to filter by record status or other fields too.
Last updated on