<?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: Layer Definition using current user/identity in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-definition-using-current-user-identity/m-p/261287#M24194</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; I mean to say is "storing the layer definition in session" is for suppose you have state layer across world and you want to show only &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;states of USA then in that case if attribute is present to differentiate states of various country then you need to do something like&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; this "Country = 'USA' " int his case country will be column.Now you can store this string in Session variable of ASP.Net and you can retrieve this session variable in Java-script and set layer definition by&amp;nbsp; &lt;/SPAN&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;setDefinitionExpression&lt;/PRE&gt;&lt;SPAN&gt; property .&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Manojraj&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Jul 2013 06:03:06 GMT</pubDate>
    <dc:creator>ManojrajTeli</dc:creator>
    <dc:date>2013-07-31T06:03:06Z</dc:date>
    <item>
      <title>Layer Definition using current user/identity</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-definition-using-current-user-identity/m-p/261284#M24191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to establish a way of partitioning layers based on a user/role in a web viewer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I currently have a web application (.Net MVC) that has an embedded map. I use the current authenticated user together with layer definition queries to get the "appropriate" data for that user. This allows me to have a single map service with all data in it, yet control visibility/access on a per user basis. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This works fine, but now I have been tasked with getting a generic web viewer (JavaScript) working in the same way. Worst case scenario is creating a web viewer (and maybe map service) for each role but I suspect there is a better way. I have been trying to find examples without any success. Maybe my approach is wrong. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone point me in the right direction?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2013 01:04:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-definition-using-current-user-identity/m-p/261284#M24191</guid>
      <dc:creator>TrevorMasters</dc:creator>
      <dc:date>2013-07-30T01:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Definition using current user/identity</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-definition-using-current-user-identity/m-p/261285#M24192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Trevor,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can absolutely do that .On User log in save the user Identity in session, from JavaScript you can get the user id and using web-service or WCF you can get the layer definition and other information and set the layer definition or you can store layer definition in session but it will degrade the performance of the application. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Manojraj&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2013 08:17:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-definition-using-current-user-identity/m-p/261285#M24192</guid>
      <dc:creator>ManojrajTeli</dc:creator>
      <dc:date>2013-07-30T08:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Definition using current user/identity</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-definition-using-current-user-identity/m-p/261286#M24193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you. It is reassuring to know I am on the right track. My JavaScript skills are not great but it looks like they are about to improve &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What do you mean by "storing the layer definition in session"? Do you just mean the actual query string? I have several layers that have layer definitions defined (basically the same query). The data sets are not huge so this has worked OK for me to date.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2013 18:40:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-definition-using-current-user-identity/m-p/261286#M24193</guid>
      <dc:creator>TrevorMasters</dc:creator>
      <dc:date>2013-07-30T18:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Definition using current user/identity</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-definition-using-current-user-identity/m-p/261287#M24194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; I mean to say is "storing the layer definition in session" is for suppose you have state layer across world and you want to show only &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;states of USA then in that case if attribute is present to differentiate states of various country then you need to do something like&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; this "Country = 'USA' " int his case country will be column.Now you can store this string in Session variable of ASP.Net and you can retrieve this session variable in Java-script and set layer definition by&amp;nbsp; &lt;/SPAN&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;setDefinitionExpression&lt;/PRE&gt;&lt;SPAN&gt; property .&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Manojraj&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jul 2013 06:03:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-definition-using-current-user-identity/m-p/261287#M24194</guid>
      <dc:creator>ManojrajTeli</dc:creator>
      <dc:date>2013-07-31T06:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Definition using current user/identity</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-definition-using-current-user-identity/m-p/261288#M24195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;One problem I have up against is that the definition query is visible in the source. For example (using your example) if I had a user that was only allowed to see the features in "Country=USA", they could change the definition and get to see other data. I have no way of stopping this. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only way around this that I can think of is to have a layer for each country (in this case).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 00:14:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-definition-using-current-user-identity/m-p/261288#M24195</guid>
      <dc:creator>TrevorMasters</dc:creator>
      <dc:date>2013-08-01T00:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Definition using current user/identity</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-definition-using-current-user-identity/m-p/261289#M24196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Trevor,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is always chance of exposing service rest endpoint and query string through java-script.Using separate services will increase maintenance work..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Manoj&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 06:47:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-definition-using-current-user-identity/m-p/261289#M24196</guid>
      <dc:creator>ManojrajTeli</dc:creator>
      <dc:date>2013-08-01T06:47:08Z</dc:date>
    </item>
  </channel>
</rss>

