{"id":283,"date":"2022-01-18T10:54:28","date_gmt":"2022-01-18T10:54:28","guid":{"rendered":"https:\/\/blog.citrus-lime.com\/crmc\/?p=283"},"modified":"2022-01-18T10:54:29","modified_gmt":"2022-01-18T10:54:29","slug":"how-to-use-docdrive365-to-integrate-permissions-between-business-units-in-dynamics-with-sites-in-sharepoint","status":"publish","type":"post","link":"https:\/\/blog.citrus-lime.com\/crmc\/how-to-use-docdrive365-to-integrate-permissions-between-business-units-in-dynamics-with-sites-in-sharepoint\/","title":{"rendered":"How to use DocDrive365 to integrate permissions between Business Units in Dynamics with Sites in SharePoint"},"content":{"rendered":"\n<p>If we take the scenario where we want to have a SharePoint Site per Business Unit that we have in Dynamics, we can model this using DocDrive365 in the following steps:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">STEP 1 \u2013 Model the SharePoint Structure for how we will handle Business Units<\/h3>\n\n\n\n<p>Add a Site per Business Unit Rule into the DocDrive365 Configuration for the Business Unit Entity.<\/p>\n\n\n\n<p>For security, we can configure each Business Unit Site to have its own Unique Permissions.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_06513C08.png\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_thumb_4F76E7C1.png\" alt=\"image\" title=\"image\" \/><\/a><\/figure>\n\n\n\n<p><strong><em>If you have access to our Demo Environment,&nbsp;<\/em><\/strong><a href=\"https:\/\/delegatedemo.crm.dynamics.com\/main.aspx?appid=9adf60cf-86a6-eb11-b1ac-000d3a32bf67&amp;pagetype=entityrecord&amp;etn=crmcs_metadatamap&amp;id=fe2f6e73-9aa7-eb11-b1ac-000d3a32bf67\" target=\"_blank\" rel=\"noreferrer noopener\"><strong><em>click here to see this rule<\/em><\/strong><\/a><strong><em>.<\/em><\/strong><\/p>\n\n\n\n<p>This leads to a new SharePoint Site for each Business Unit we add to Dynamics:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_3D2E20FF.png\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_thumb_117D5703.png\" alt=\"image\" title=\"image\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_7F349040.png\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_thumb_3EFE76C6.png\" alt=\"image\" title=\"image\" \/><\/a><\/figure>\n\n\n\n<p>As we switched the [Inherit Permissions] to \u2018Unique Permissions\u2019, this means that each SharePoint created for a BU has its own set of permissions \u2013 rather than simply defaulting to the permissions of the Parent Site.<\/p>\n\n\n\n<p>This allows us to start defining the permissions we want in SharePoint to match those we define for Dynamics.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">STEP 2 \u2013 Define the Security<\/h3>\n\n\n\n<p>If we want to model a simple security system where each Business Unit Site is only available to the Users in that Business Unit, we can do this in a simple set of steps.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Each Business Unit in Dynamics automatically maintains a Team containing all the Users assigned to that Business Unit (this is part of the base functionality in Dynamics), we are going to use this Team to define who has access to the SharePoint Site for the Team.<\/li><li>To put this to use, we first add a new Lookup Field from the Business Unit Entity to the Team Entity \u2013 so we have a point-to-point link from the Business Unit to the Team that we can draw on.<\/li><li>We can add a DocDrive Dynamics-to-SharePoint Security Rule to add the Team connected to the Business Unit as a Group in SharePoint with access to the Site for that Business Unit.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_50DB0A93.png\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_thumb_1A6CE942.png\" alt=\"image\" title=\"image\" \/><\/a><\/figure>\n\n\n\n<p><strong><em>If you have access to our Demo Environment for this scenario,&nbsp;<\/em><\/strong><a href=\"https:\/\/delegatedemo.crm.dynamics.com\/main.aspx?appid=9adf60cf-86a6-eb11-b1ac-000d3a32bf67&amp;pagetype=entityrecord&amp;etn=crmcs_relatedpartysyncfield&amp;id=c9273b7a-b0a7-eb11-b1ac-000d3a32bf67\" target=\"_blank\" rel=\"noreferrer noopener\"><em>click here to see this rule<\/em><\/a><strong><\/strong><strong><em>.<\/em><\/strong><\/p>\n\n\n\n<p>The addition of the Security Rule connected to the Lookup field to the Team will then set the Security Permissions in each SharePoint Site created for each Business Unit.<\/p>\n\n\n\n<p>We can see this in the SharePoint Site for either of our Business Units \u2013 most notably by clicking into Site Settings and into Permissions:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_7332A00C.png\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_thumb_32FC8692.png\" alt=\"image\" title=\"image\" \/><\/a><\/figure>\n\n\n\n<p>The SharePoint Site is shared with the France BU Group in SharePoint which is being synchronised with the France BU Team in Dynamics \u2013 this means that any Users added to removed to the France Business Unit will automatically be granted or removed from accessing the corresponding SharePoint Site here.<\/p>\n\n\n\n<p>We can control the security from the Business Unit or Team in Dynamics:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_4EA11288.png\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_thumb_0E6AF90E.png\" alt=\"image\" title=\"image\" \/><\/a><\/figure>\n\n\n\n<p>And know this is fully integrated into SharePoint:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_7C22324B.png\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_thumb_54E7E916.png\" alt=\"image\" title=\"image\" \/><\/a><\/figure>\n\n\n\n<p>By default this means that each Business Unit has its own set of \u2018Chinese Walls\u2019 to prevent a User in Romania from being able to access Documents only intended for the French Business Unit and vice versa.<\/p>\n\n\n\n<p>That sets up for the Sites approach to SharePoint \u2013 we can now look at how we put this to use.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>STEP 3 \u2013 Model the SharePoint Structure for how we will handle Company Accounts<\/strong><\/h3>\n\n\n\n<p>In our next step, we will see this in action for Company Accounts in these Business Units, and then look at sharing for when we might want to share Documents by Account for the BUs.<\/p>\n\n\n\n<p>We can start by defining what type of Document Storage we want for each Company we add to Dynamics.<\/p>\n\n\n\n<p>In this case, we can setup a simple set of Rules that:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Parent Rule that places the Document Storage for a Company in the right SharePoint Site depending on the Business Unit for the Company.<\/li><li>Bucket Rule that ensures a Document Library is present for \u2018Client Documents\u2019 in the SharePoint Site<\/li><li>Record Rule that creates a Folder specifically for this Company in that Document Library<\/li><\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>NOTE:&nbsp;<\/strong>For more information on these types of rules,&nbsp;<a href=\"https:\/\/www.crmcs.co.uk\/content\/docman-day-one.aspx\" target=\"_blank\" rel=\"noreferrer noopener\">this article on our site may be useful<\/a>&nbsp;to explain how the Rules Engine in DocDrive365 is configured.<\/p><\/blockquote>\n\n\n\n<p>This gives us the following Account Entity Definition in DocDrive:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_5790A4C7.png\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_thumb_4547DE05.png\" alt=\"image\" title=\"image\" \/><\/a><\/figure>\n\n\n\n<p><strong><em>If you have access to our Demo Environment for this scenario,&nbsp;<\/em><\/strong><a href=\"https:\/\/delegatedemo.crm.dynamics.com\/main.aspx?appid=9adf60cf-86a6-eb11-b1ac-000d3a32bf67&amp;pagetype=entityrecord&amp;etn=crmcs_metadataentity&amp;id=6203a788-89f1-e811-a971-000d3a18c23c\" target=\"_blank\" rel=\"noreferrer noopener\">click here to see this rule<\/a><em><\/em><strong><\/strong><strong><em>.<\/em><\/strong><\/p>\n\n\n\n<p>This set of rules starts adding Folders to our SharePoint Sites on the basis of one Folder per Account Record in Dynamics.<\/p>\n\n\n\n<p>Initially each Folder inherits the permissions defined for that SharePoint Site \u2013 and so grants access on the same basis:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Users in our France BU have access to the Company Folders in their Business Unit<\/li><li>Users in our Romania BU have access to the Company Folders for their Business Unit<\/li><\/ul>\n\n\n\n<p>Assuming we are logged in as a User in the Parent Business Unit who can see both BUs, we can see this from Dynamics to SharePoint:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_4BFAE788.png\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_thumb_39B220C6.png\" alt=\"image\" title=\"image\" \/><\/a><\/figure>\n\n\n\n<p>The top 5 Accounts sitting under our France BU, and so appearing as Folders in the French SharePoint Site:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_2B73A7D6.png\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_thumb_2E1C6387.png\" alt=\"image\" title=\"image\" \/><\/a><\/figure>\n\n\n\n<p>This gives us the basic level of dividing Documents by Business Unit so our SharePoint Security works in the same way as the Security we have in Dynamics.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">STEP 4 \u2013 Share a Company with both France and Romania<\/h3>\n\n\n\n<p>Currently our Company Accounts are split 5 and 5 between our Business Units in a consistent model.<\/p>\n\n\n\n<p>But, what if we want so share a Company between both Business Units?&nbsp; Or we want to limit a particular Company to a smaller subset of Users?<\/p>\n\n\n\n<p>We can do this by opening the Company in Dynamics and amending its sharing \/ permissions.<\/p>\n\n\n\n<p>DocDrive provides a Grid control where this can be done manually, or we can build this into our Workflow for how User\u2019s use Dynamics \u2013 in my case here, I\u2019ve built a simple Workflow that changes the permissions for this particular Company.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_thumb_0D9523D5.png\" alt=\"image\" title=\"image\" \/><\/figure>\n\n\n\n<p><a href=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_34CF6D0A.png\"><strong><em><\/em><\/strong><\/a><\/p>\n\n\n\n<p><strong><em>Using the DocDrive Grid to share an Account in the French BU with both the French BU Team and the Romanian BU Team<\/em><\/strong><\/p>\n\n\n\n<p>We may not want our Users to have access to this type of sharing, so we may build this into our Workflow to trigger the sharing within our Solution\u2019s Business Logic.<\/p>\n\n\n\n<p>This can be done in Dynamic\u2019s Workflow or using the DocDrive Custom Connector in Power Automate.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_7B4C5D12.png\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_thumb_3B164398.png\" alt=\"image\" title=\"image\" \/><\/a><\/figure>\n\n\n\n<p>Either way \u2013 this setting of permissions via DocDrive triggers the following in SharePoint:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The Folder for the Account is initially set to Inherit Permissions and so using whatever permissions the SharePoint Site is using for the Business Unit.<\/li><li>As the permissions are set \u2013 this \u2018breaks\u2019 into Unique Permissions for the Folder<\/li><li>The Unique Permissions being the permissions we have defined in the Grid or the Workflow<\/li><li>In this case, sharing with both the FRA Team and the ROM Team to share out across both Business Units<\/li><\/ul>\n\n\n\n<p>This gives us certain Account Folders that are only visible to ROM, and other Account Folders that are only visible to FRA \u2013 but this Account Folder is in the middle of the Venn Diagram in being available to both Business Units. (but not to any other BUs that we may add, as its just the two initially)<\/p>\n\n\n\n<p>We can see this in action by logging into Dynamics as an Example Romanian User \u2013 they now see their 5 Accounts + the 1 French Account that is now shared:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_6FB69FD3.png\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_thumb_5D6DD911.png\" alt=\"image\" title=\"image\" \/><\/a><\/figure>\n\n\n\n<p>Our ROM User then also has limited rights within the France SharePoint Site \u2013 as per our rules, they do not have any rights over the Site or the Library, but they do now have rights to that particular Folder for that particular Account.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_4B25124F.png\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_thumb_38DC4B8D.png\" alt=\"image\" title=\"image\" \/><\/a><\/figure>\n\n\n\n<p>We can peek into SharePoint to see how these permissions have been replicated from Dynamics to SharePoint for our two Business Units:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_269384CB.png\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/image_thumb_7F593B95.png\" alt=\"image\" title=\"image\" \/><\/a><\/figure>\n\n\n\n<p>The ROM User can see the Client Documents Library in the FRA Site but only sees the single Folder they have permissions to in this Library.<\/p>\n\n\n\n<p>This sharing can then be easily reversed again in much the same fashion \u2013 either using the Grid and removing the Sharing, or having a 2nd workflow that does the same.<\/p>\n\n\n\n<p>This can also be automated using DocDrive SharePoint Security Rules configured in the DocDrive365 App \u2013 but to keep this how-to to a manageable length, this will be detailed in a separate article.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What benefits does this give us?<\/h3>\n\n\n\n<p>In some ways, this is similar to the native Sharing System in Dynamics and Power Apps \u2013 just with the added benefit of replicating to SharePoint as well as Dynamics. (whereas by default, the security in Dynamics has not influence on SharePoint leaving permissions to be configured separately)<\/p>\n\n\n\n<p>But by using Teams in Dynamics that are integrated as Permission Groups in SharePoint this gives us a number of benefits:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>DocDrive maintains a list of permissions in the custom \u2018Permission Entries\u2019 Entity \u2013 so we can always see or report on what is shared with who<\/li><li>Permissions can be managed at the By-User level; but managing at the By-Team level makes for a much easier Governance Model \u2013 as any User removed from a particular Team then loses rights to all the SharePoint Locations that this Team granted them access for, and we never find ourselves having to remove individual permissions.<\/li><li>Using the Automatic Teams that Dynamics creates for a Business Unit means that we have self-building Teams \u2013 so as a User may move from one Business Unit to Business Unit, the permissions are automatically set.&nbsp; This can again help our security governance.<\/li><li>Manual Teams can then be defined in Dynamics and used to have a consistent security model.<\/li><\/ul>\n\n\n\n<p>We\u2019ve done extensive work helping clients integrate their SharePoint Security and Dynamics Security Models together \u2013 and so looked at many ways of making this possible with the easiest and best possible governance, and this approach of sharing-by-team is our best proposed way forward of solving the Dynamics-to-SharePoint replication problem and having a strong consistent and easily documented Security Model across both systems.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Further Reading<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>DocDrive365 Security Day One for getting started with Dynamics to SharePoint Permissions<\/strong><\/p><p><a href=\"https:\/\/www.crmcs.co.uk\/content\/docdrive365-security-day-one-getting-started-with-dynamics-to-sharepoint-permissions.aspx\">https:\/\/www.crmcs.co.uk\/content\/docdrive365-security-day-one-getting-started-with-dynamics-to-sharepoint-permissions.aspx<\/a><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>If we take the scenario where we want to have a SharePoint Site per Business Unit that we have in Dynamics, we can model this using DocDrive365 in the following steps: STEP 1 \u2013 Model the SharePoint Structure for how we will handle Business Units Add a Site per Business Unit Rule into the DocDrive365<\/p>\n","protected":false},"author":43,"featured_media":88,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_price":"","_stock":"","_tribe_ticket_header":"","_tribe_default_ticket_provider":"","_tribe_ticket_capacity":"0","_ticket_start_date":"","_ticket_end_date":"","_tribe_ticket_show_description":"","_tribe_ticket_show_not_going":false,"_tribe_ticket_use_global_stock":"","_tribe_ticket_global_stock_level":"","_global_stock_mode":"","_global_stock_cap":"","_tribe_rsvp_for_event":"","_tribe_ticket_going_count":"","_tribe_ticket_not_going_count":"","_tribe_tickets_list":"[]","_tribe_ticket_has_attendee_info_fields":false,"footnotes":""},"categories":[4],"tags":[],"class_list":{"0":"post-283","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-docdrive365"},"featured_image_src":"https:\/\/blog.citrus-lime.com\/crmc\/wp-content\/uploads\/sites\/30\/2021\/12\/DocDriveSiteimageclouds-scaled.jpg","author_info":{"display_name":"jadesmith","author_link":"https:\/\/blog.citrus-lime.com\/crmc\/author\/jadesmith\/"},"_links":{"self":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts\/283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/users\/43"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/comments?post=283"}],"version-history":[{"count":1,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts\/283\/revisions"}],"predecessor-version":[{"id":284,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts\/283\/revisions\/284"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/media\/88"}],"wp:attachment":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/media?parent=283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/categories?post=283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/tags?post=283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}