Hide external links in Microsoft Dynamics CRM/365 Portal

By | May 16, 2017

Introduction:

Very often we need to provide a link that redirects to an external link like Company Website, to be accessed by the portal users on the Microsoft Dynamics 365 Portal.

However, in some cases, we need to restrict the access to those external links based on the Roles assigned to the portal user or depending on whether the users are authenticated users or non-authenticated users.

Some of the examples for this could be we want to restrict the access to ‘API Documentation’ link if;

  • the portal user does not have a specific role say ‘Premium Users’ role OR
  • the portal user is not authenticated to portal OR
  • perhaps the other way round, only if the portal user has not signed-in show the link

Hiding links in the Microsoft Dynamics 365 Portal:

It is very easy to hide web links to web pages using Access control Rule entity.

We just need to create new Access Control Rule entity record for that web page with Restrict Read right and add roles we need to provide access to the web page.

To know more about Access Control Rule refer this link.

Note: There is no direct way available to apply access rules on web links that open external links.

Workaround to apply Access Rules on Web Link that redirects to an external link:

  1. Open Web link record and add the external URL. In this example, we have opened the ‘API Documentation’ Web Link and added the external URL as ‘http://www.inogic.com/’ as seen in the screenshot below;

Hide external links in Microsoft Dynamics CRM Portal

2. Select the Web Page lookup and create new web page entity record with a blank ‘Page Template’. In this example, we have created ‘API Documentation Blank Page’ and selected the ‘Page Template’ as ‘Blank’ as seen in the screenshots below;

Hide external links in Microsoft Dynamics CRM Portal

3. Now, create a new ‘Web Page Access Control Rule’, select ‘API Documentation Blank Page’ as a ‘Web Page’ and add appropriate ‘Web Roles’ (like Authenticated Users, Administrators) that you want to grant access. Then add ‘Publishing States’ as ‘Published’.

Hide external links in Microsoft Dynamics CRM Portal

4. Now, Select this newly created web page on the ‘API Documentation’ Web Link and save the Web Link record as seen in the screenshot below;

Hide external links in Microsoft Dynamics CRM Portal

5. By following the steps mentioned above, we can easily apply Access Rule on Web Links with external links.

6. With the above configuration, the API Documentation link will only be displayed when the user logs in to the portal as seen in the screenshots below;

 Before login:

Hide external links in Microsoft Dynamics CRM Portal

After login:

Hide external links in Microsoft Dynamics CRM Portal

 

Conclusion:

In a nutshell, to apply access control rule for WEB LINKS that are to an external page, we could create a WEB PAGE record and apply the rule to the WEB PAGE and have it trickle down to the WEB LINK.

4 thoughts on “Hide external links in Microsoft Dynamics CRM/365 Portal

  1. Pankaj Kumar

    Hi Inogic,
    I have created a weblink with parent weblink as null and also page lookup to null.
    I am unable to hide my weblink, why i have chosen null as page because if i choose any page after sign in it will show below to that.
    Example : I choose Home page then my link will be below Home button. If i choose what you have suggested it shows like MyProfile -> MyProfile means nested weblink.
    Please suggest on this.

    1. Inogic

      To hide external links you must set Page lookup to new Web Page and Page Template of that Web Page must be set to “Blank Page” template record. You can see there is a “Blank Page” record of “Page Template” entity. So the steps would be,

      1) Create a Web Link with Parent Web Link selected as “Home” or any other Page where you would like to show under.
      2) Add external URL on that Web Link record.
      3) Set “Page” lookup. Create new Web Page where you will Page Template as “Blank Page” template. Set this new Web Page in the “Page” lookup
      4) Create Web Page Access Control Rule. Select newly created Web Page in step 3 and select the Web roles in this Web Page Access Control rule record.
      5) Make sure that the Right is set to Restrict read and Publishing States to Published.

      Hope this helps!

      Thanks!

  2. Pankaj Kumar

    Thanks for your reply,
    I am able to hide the the link as you suggested, but the issue for me is : it is a separate weblink in primary navigation with Parent Web Link null and Page is also null.
    If i choose Page as you suggested it’s getting a drop-down with the same name of weblink name and while click on the web-link(created with the same name) it opens a blank page.
    Hope it’s clear for you as well, if not please provide link so that i will be able to attach the screenshots.

Comments are closed.