<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Description leads to You do not have permissions to access this resource or perform this operation. in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/description-leads-to-you-do-not-have-permissions/m-p/861143#M11793</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Frank,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; This is not tested but I think you can take care of this by modifying the code for the PopupMnuInfo.js in the LayerList widget.&amp;nbsp; Here is the function that adds the layers url to a html anchor tag and the issue is that the url does not contain the token info so you are getting a permission denied.&amp;nbsp; But the fact that you have the metadata url in the description property for the service layer leads to a workaround.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;_getATagLabel: function() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var url;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var label;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.info(this._layerInfo);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var itemLayerId = this._layerInfo._isItemLayer &amp;amp;&amp;amp; this._layerInfo._isItemLayer();

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (itemLayerId) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url = portalUrlUtils.getItemDetailsPageUrl(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; portalUrlUtils.getStandardPortalUrl(this.layerListWidget.appConfig.portalUrl),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itemLayerId);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label = this.nls.itemShowItemDetails;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else if (this._layerInfo.layerObject &amp;amp;&amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this._layerInfo.layerObject.url &amp;amp;&amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (this._layerType === "CSVLayer" || this._layerType === "KMLLayer")) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url = this._layerInfo.layerObject.url;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label = this.nls.itemDownload;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else if (this._layerInfo.layerObject &amp;amp;&amp;amp; this._layerInfo.layerObject.url) {
/* if there is a description property then use the url from there*/
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(this._layerInfo.description &amp;amp;&amp;amp; this._layerInfo.description.indexOf("This is where you need to put the portion of your url to check for"){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url = this._layerInfo.description;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }else{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url = this._layerInfo.layerObject.url;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label = this.nls.itemDesc;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url = '';
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label = this.nls.itemDesc;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return '&amp;lt;a class="menu-item-description" target="_blank" href="' +
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url + '"&amp;gt;' + label + '&amp;lt;/a&amp;gt;';
&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 10:40:36 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2021-12-12T10:40:36Z</dc:date>
    <item>
      <title>Description leads to You do not have permissions to access this resource or perform this operation.</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/description-leads-to-you-do-not-have-permissions/m-p/861142#M11792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have a significant number map services in a number of AGO maps.&amp;nbsp; Many of these services come from secure&amp;nbsp; ArcServer services that we have diligently created Map image layer files for.&amp;nbsp; We have then embed these layer files with the user name and password to the services.&amp;nbsp; The one issue we have is if the user clicks on the "Description" button for one of the layers in the service they get the following error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE class="topTable" style="font-family: 'Times New Roman';" width="100%"&gt;&lt;TBODY&gt;&lt;TR valign="top"&gt;&lt;TD&gt;&lt;STRONG&gt;ArcGIS Portal Directory&lt;/STRONG&gt; | &lt;A href="http://utility.arcgis.com/usrsvcs"&gt;Home&lt;/A&gt;&lt;/TD&gt;&lt;TD align="right"&gt;&lt;A href="http://utility.arcgis.com/usrsvcs/rest/login"&gt;Login&lt;/A&gt; | &lt;A href="http://utility.arcgis.com/usrsvcs/rest/community/signup"&gt;Signup&lt;/A&gt; | &lt;A href="http://utility.arcgis.com/usrsvcs/rest/generateToken"&gt;Generate Token&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE class="navTable" style="font-family: 'Times New Roman';" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="breadcrumbs"&gt;Error&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P class="gwDiv" style="color: #000000; font-family: 'Times New Roman'; font-size: medium;"&gt;&lt;/P&gt;&lt;H3&gt;You do not have permissions to access this resource or perform this operation.&lt;/H3&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error: &lt;/STRONG&gt;403&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there anyway to bybass this error?&amp;nbsp; We would really like them to be able to get to the metadata for the individual layers.&amp;nbsp; We do have url's for each of those metadata files, and we have currently embeded the url in the description found with the ArcServer rest endpoint for the services.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thoughts or ways to not have this rather unintelligent result occur to our users?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks you for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 23:00:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/description-leads-to-you-do-not-have-permissions/m-p/861142#M11792</guid>
      <dc:creator>FrankRoberts</dc:creator>
      <dc:date>2015-08-19T23:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Description leads to You do not have permissions to access this resource or perform this operation.</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/description-leads-to-you-do-not-have-permissions/m-p/861143#M11793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Frank,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; This is not tested but I think you can take care of this by modifying the code for the PopupMnuInfo.js in the LayerList widget.&amp;nbsp; Here is the function that adds the layers url to a html anchor tag and the issue is that the url does not contain the token info so you are getting a permission denied.&amp;nbsp; But the fact that you have the metadata url in the description property for the service layer leads to a workaround.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;_getATagLabel: function() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var url;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var label;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.info(this._layerInfo);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var itemLayerId = this._layerInfo._isItemLayer &amp;amp;&amp;amp; this._layerInfo._isItemLayer();

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (itemLayerId) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url = portalUrlUtils.getItemDetailsPageUrl(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; portalUrlUtils.getStandardPortalUrl(this.layerListWidget.appConfig.portalUrl),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itemLayerId);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label = this.nls.itemShowItemDetails;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else if (this._layerInfo.layerObject &amp;amp;&amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this._layerInfo.layerObject.url &amp;amp;&amp;amp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (this._layerType === "CSVLayer" || this._layerType === "KMLLayer")) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url = this._layerInfo.layerObject.url;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label = this.nls.itemDownload;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else if (this._layerInfo.layerObject &amp;amp;&amp;amp; this._layerInfo.layerObject.url) {
/* if there is a description property then use the url from there*/
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(this._layerInfo.description &amp;amp;&amp;amp; this._layerInfo.description.indexOf("This is where you need to put the portion of your url to check for"){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url = this._layerInfo.description;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }else{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url = this._layerInfo.layerObject.url;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label = this.nls.itemDesc;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url = '';
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label = this.nls.itemDesc;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return '&amp;lt;a class="menu-item-description" target="_blank" href="' +
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url + '"&amp;gt;' + label + '&amp;lt;/a&amp;gt;';
&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:40:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/description-leads-to-you-do-not-have-permissions/m-p/861143#M11793</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T10:40:36Z</dc:date>
    </item>
  </channel>
</rss>

