{"id":28139,"date":"2021-06-04T08:55:07","date_gmt":"2021-06-04T08:55:07","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=28139"},"modified":"2023-09-08T12:59:47","modified_gmt":"2023-09-08T07:29:47","slug":"how-to-hide-portal-search-for-anonymous-users-in-powerapps-portal","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2021\/06\/how-to-hide-portal-search-for-anonymous-users-in-powerapps-portal\/","title":{"rendered":"How to Hide Portal Search for Anonymous Users in PowerApps Portal"},"content":{"rendered":"<h3 style=\"text-align: justify;\"><strong>Introduction<\/strong><\/h3>\n<p style=\"text-align: justify;\">We recently had a requirement in Power Apps Partner Portal where the client specifically wanted Portal search option you see in the navigation bar to be seen and accessible ONLY for users who logs into the portal. With this, non-authenticated users will have no unauthorized access to CRM data visible in portal even via search.<\/p>\n<p style=\"text-align: justify;\">As most of you all might know, the site setting titled \u201cSearch\/Enabled\u201d and setting the value as \u201cfalse\u201d COMPLETELY hide the Portal search option irrespective of whether you have logged into the portal or not. So that was not an option for us since we wanted to show the search option once the user has logged into the portal.<\/p>\n<p style=\"text-align: justify;\">So, the next option we had in our mind was the typical way of using Web Page Access Control Rules. We did try adding the rules to the already existing system created web page \u201cSearch\u201d as shown below:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/1-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28140 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/1-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png\" alt=\"Hide Portal Search For Anonymous Users In PowerApps\" width=\"1160\" height=\"351\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/1-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png 1160w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/1-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink-300x91.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/1-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink-768x232.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/1-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink-1024x310.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/1-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink-660x200.png 660w\" sizes=\"(max-width: 1160px) 100vw, 1160px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u201cSearch Page-Admin Access\u201d was created for users with Administrator\u2019s web role and the other one \u201cSearch Page-Non Admin Access\u201d was created for users with Authenticated Users web role. Usually, this would make the page invisible if the user is not logged in. But in our case, though the search icon (as seen in the screenshot below) was still visible, but because we added the web page access control rules, when we tried to search something it automatically redirected to sign in page. This would ensure that you cannot see search results without logging to the portal.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/2-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28141 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/2-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png\" alt=\"Hide Portal Search For Anonymous Users In PowerApps\" width=\"434\" height=\"76\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/2-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png 434w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/2-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink-300x53.png 300w\" sizes=\"(max-width: 434px) 100vw, 434px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Though this was half serving the purpose (i.e., users who have not logged in to the portal can\u2019t use search functionality properly), our main motive of making the Search option NOT visible to whoever did not login to the portal was still an issue.<\/p>\n<p style=\"text-align: justify;\">It\u2019s in that situation after some research, we figured a solution for this problem.<\/p>\n<ol style=\"text-align: justify;\">\n<li>Go to the Web Templates section and click on the template named \u201cHeader\u201d.<\/li>\n<\/ol>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/3-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28142 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/3-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png\" alt=\"Hide Portal Search For Anonymous Users In PowerApps\" width=\"1338\" height=\"414\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/3-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png 1338w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/3-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink-300x93.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/3-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink-768x238.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/3-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink-1024x317.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/3-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink-660x204.png 660w\" sizes=\"(max-width: 1338px) 100vw, 1338px\" \/><\/a><\/p>\n<ol style=\"text-align: justify;\" start=\"2\">\n<li>Now search for \u201csearch\u201d in the template as seen below:<\/li>\n<\/ol>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/4-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28143 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/4-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png\" alt=\"Hide Portal Search For Anonymous Users In PowerApps\" width=\"1186\" height=\"529\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/4-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png 1186w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/4-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink-300x134.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/4-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink-768x343.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/4-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink-1024x457.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/4-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink-660x294.png 660w\" sizes=\"(max-width: 1186px) 100vw, 1186px\" \/><\/a><\/p>\n<ol style=\"text-align: justify;\" start=\"3\">\n<li>Now add the below code:<\/li>\n<\/ol>\n<p style=\"text-align: justify;\"><strong>{% if user %}<\/strong><\/p>\n<p style=\"text-align: justify;\">Just above the already present line written below:<\/p>\n<p style=\"text-align: justify;\"><strong><em>{% assign search_enabled = settings[&#8216;Search\/Enabled&#8217;] | boolean | default:true %}<\/em><\/strong><\/p>\n<ol style=\"text-align: justify;\" start=\"4\">\n<li>And also add the below code:<\/li>\n<\/ol>\n<p style=\"text-align: justify;\"><strong>{% endif %}<\/strong><\/p>\n<p style=\"text-align: justify;\">Just above the already present line written below:<\/p>\n<p style=\"text-align: justify;\"><strong><em>&lt;li class=&#8221;divider-vertical&#8221; aria-hidden=&#8221;true&#8221;&gt;&lt;\/li&gt;<\/em><\/strong><\/p>\n<p style=\"text-align: justify;\">The whole code changes will look like this:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/5-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28144 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/5-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png\" alt=\"Hide Portal Search For Anonymous Users In PowerApps\" width=\"818\" height=\"374\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/5-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png 818w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/5-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink-300x137.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/5-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink-768x351.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/5-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink-660x302.png 660w\" sizes=\"(max-width: 818px) 100vw, 818px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Basically, what we did is we are checking if any user details found for logged in users, then only display the search icon or else not. And this is how it\u2019s reflected in portal as shown below and the search icon is hidden!!<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/6-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28145 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/6-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png\" alt=\"Hide Portal Search For Anonymous Users In PowerApps\" width=\"470\" height=\"79\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/6-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png 470w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/6-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink-300x50.png 300w\" sizes=\"(max-width: 470px) 100vw, 470px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">And the search is visible once the user logs in to the portal as shown below:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/7-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28146 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/7-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png\" alt=\"Hide Portal Search For Anonymous Users In PowerApps\" width=\"397\" height=\"88\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/7-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink.png 397w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/06\/7-Hide-Portal-Search-For-Anonymous-Users-In-PowerApps-ink-300x66.png 300w\" sizes=\"(max-width: 397px) 100vw, 397px\" \/><\/a><\/p>\n<h3 style=\"text-align: justify;\"><strong>Conclusion:<\/strong><\/h3>\n<p style=\"text-align: justify;\">In this way, by editing the header template as explained above we can hide the portal search in the navigation bar from users who have not logged in to the portal.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/product\/integrations\/inolink-quickbooks-microsoft-dynamics-crm\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/04\/1.jpg\" alt=\"inolink\" width=\"800\" height=\"200\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\n","protected":false},"excerpt":{"rendered":"<p>Introduction We recently had a requirement in Power Apps Partner Portal where the client specifically wanted Portal search option you see in the navigation bar to be seen and accessible ONLY for users who logs into the portal. With this, non-authenticated users will have no unauthorized access to CRM data visible in portal even via\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2021\/06\/how-to-hide-portal-search-for-anonymous-users-in-powerapps-portal\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[37,44,38,2053,2763],"tags":[2176],"class_list":["post-28139","post","type-post","status-publish","format-standard","hentry","category-microsoft-portals","category-power-apps","category-microsoft-powerapps","category-power-apps-portals","category-power-pages","tag-powerapps-portals"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/28139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=28139"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/28139\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=28139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=28139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=28139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}