<?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: Filter data within a layer based on user's role in ArcGIS Enterprise Extensibility Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-extensibility-questions/filter-data-within-a-layer-based-on-user-s-role/m-p/1222023#M301</link>
    <description>&lt;P&gt;Dear Fabio,&lt;/P&gt;&lt;P&gt;I hope you are doing well,&lt;/P&gt;&lt;P&gt;You should first get the user role with this code ("java"):&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;var &lt;/SPAN&gt;&lt;SPAN&gt;roles &lt;/SPAN&gt;= &lt;SPAN&gt;ServerUtilities&lt;/SPAN&gt;.&lt;SPAN&gt;getServerUserInfo&lt;/SPAN&gt;().getRoles()&lt;SPAN&gt;;&lt;BR /&gt;var role = roles.next();&lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;variable rules icludes roles of the user which is entered and then the id_groups of the user who is member of them, so if you want to get the id_groups of the groups you should do .next() again.&lt;/P&gt;&lt;P&gt;the you should create a JSONObject and define the whereclause and put in it:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;JSONObject inputParams &lt;/SPAN&gt;= &lt;SPAN&gt;new &lt;/SPAN&gt;JSONObject(&lt;SPAN&gt;operationInput&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;inputParams&lt;/SPAN&gt;.put(&lt;SPAN&gt;"where"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Here you should put your clause in SQL format"&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;operationInput &lt;/SPAN&gt;= &lt;SPAN&gt;inputParams&lt;/SPAN&gt;.toString()&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; if you want to filter specific layers of specific field you can use these codes,&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;inputParams&lt;/SPAN&gt;.put(&lt;SPAN&gt;"layers"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"0"&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;inputParams&lt;/SPAN&gt;.put(&lt;SPAN&gt;"layerDefs"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;layerDefs&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Best regards.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Oct 2022 13:36:10 GMT</pubDate>
    <dc:creator>Amir-Sarrafzadeh-Arasi</dc:creator>
    <dc:date>2022-10-14T13:36:10Z</dc:date>
    <item>
      <title>Filter data within a layer based on user's role</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-extensibility-questions/filter-data-within-a-layer-based-on-user-s-role/m-p/842868#M169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;is there any sample about SOI to filter data within a layer based on the user's role?&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;Fabio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2016 15:41:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-extensibility-questions/filter-data-within-a-layer-based-on-user-s-role/m-p/842868#M169</guid>
      <dc:creator>FabioD_Ovidio</dc:creator>
      <dc:date>2016-06-01T15:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data within a layer based on user's role</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-extensibility-questions/filter-data-within-a-layer-based-on-user-s-role/m-p/842869#M170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can see the sample in sdk arcobjects:&lt;/P&gt;&lt;P&gt;C:\Program Files (x86)\ArcGIS\DeveloperKit10.4\Samples\ArcObjectsNet\ServerLayerAccessSOI&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2016 07:58:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-extensibility-questions/filter-data-within-a-layer-based-on-user-s-role/m-p/842869#M170</guid>
      <dc:creator>nicogis</dc:creator>
      <dc:date>2016-06-08T07:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data within a layer based on user's role</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-extensibility-questions/filter-data-within-a-layer-based-on-user-s-role/m-p/842870#M171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thanks!&lt;/P&gt;&lt;P&gt;I need anyway a sample about data access inside a layer (so filter rows based on user role). Do you know anyone?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Fabio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2016 15:43:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-extensibility-questions/filter-data-within-a-layer-based-on-user-s-role/m-p/842870#M171</guid>
      <dc:creator>FabioD_Ovidio</dc:creator>
      <dc:date>2016-06-08T15:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data within a layer based on user's role</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-extensibility-questions/filter-data-within-a-layer-based-on-user-s-role/m-p/842871#M172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can see this sample &lt;A href="https://github.com/ceddc/devsummit-berlin-2015-SOI/tree/b6b41e77f873ffd0b1c868cb04dc754cb37f58e1/FilterAccessSOI" title="https://github.com/ceddc/devsummit-berlin-2015-SOI/tree/b6b41e77f873ffd0b1c868cb04dc754cb37f58e1/FilterAccessSOI"&gt;devsummit-berlin-2015-SOI/FilterAccessSOI at b6b41e77f873ffd0b1c868cb04dc754cb37f58e1 · ceddc/devsummit-berlin-2015-SOI …&lt;/A&gt;&amp;nbsp; and use &lt;SPAN class="usertext"&gt;layerDefs&amp;nbsp; of ExportMap Rest to filter rows using a definition expressions&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2016 14:11:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-extensibility-questions/filter-data-within-a-layer-based-on-user-s-role/m-p/842871#M172</guid>
      <dc:creator>nicogis</dc:creator>
      <dc:date>2016-06-13T14:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data within a layer based on user's role</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-extensibility-questions/filter-data-within-a-layer-based-on-user-s-role/m-p/1222023#M301</link>
      <description>&lt;P&gt;Dear Fabio,&lt;/P&gt;&lt;P&gt;I hope you are doing well,&lt;/P&gt;&lt;P&gt;You should first get the user role with this code ("java"):&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;var &lt;/SPAN&gt;&lt;SPAN&gt;roles &lt;/SPAN&gt;= &lt;SPAN&gt;ServerUtilities&lt;/SPAN&gt;.&lt;SPAN&gt;getServerUserInfo&lt;/SPAN&gt;().getRoles()&lt;SPAN&gt;;&lt;BR /&gt;var role = roles.next();&lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;variable rules icludes roles of the user which is entered and then the id_groups of the user who is member of them, so if you want to get the id_groups of the groups you should do .next() again.&lt;/P&gt;&lt;P&gt;the you should create a JSONObject and define the whereclause and put in it:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;JSONObject inputParams &lt;/SPAN&gt;= &lt;SPAN&gt;new &lt;/SPAN&gt;JSONObject(&lt;SPAN&gt;operationInput&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;inputParams&lt;/SPAN&gt;.put(&lt;SPAN&gt;"where"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Here you should put your clause in SQL format"&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;operationInput &lt;/SPAN&gt;= &lt;SPAN&gt;inputParams&lt;/SPAN&gt;.toString()&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; if you want to filter specific layers of specific field you can use these codes,&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;inputParams&lt;/SPAN&gt;.put(&lt;SPAN&gt;"layers"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"0"&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;inputParams&lt;/SPAN&gt;.put(&lt;SPAN&gt;"layerDefs"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;layerDefs&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 13:36:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-extensibility-questions/filter-data-within-a-layer-based-on-user-s-role/m-p/1222023#M301</guid>
      <dc:creator>Amir-Sarrafzadeh-Arasi</dc:creator>
      <dc:date>2022-10-14T13:36:10Z</dc:date>
    </item>
  </channel>
</rss>

