<?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: apply sde privileges to another FC  in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/apply-sde-privileges-to-another-fc/m-p/150655#M11662</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;before you go too far with providing code samples, yours is not readable in its current form&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" href="https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting"&gt;Code Formatting the Basics ++&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;will get you started and you haven't indicated how much arcpy you are familiar with and why you have to do this via code in the first place, and can you accomplish what you want to do manually?&amp;nbsp; If you have a current workflow that uses tools in arctoolbox, then the coding is simple.&amp;nbsp; Processes, methods and properties that don't exist in arctoolbox can be accessed &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy/what-is-arcpy-.htm"&gt;&lt;STRONG&gt;through arcpy&lt;/STRONG&gt;&lt;/A&gt;... some, but not all.&amp;nbsp; So if you could fill in the gaps, that would be great&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Oct 2017 21:43:35 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2017-10-10T21:43:35Z</dc:date>
    <item>
      <title>apply sde privileges to another FC</title>
      <link>https://community.esri.com/t5/python-questions/apply-sde-privileges-to-another-fc/m-p/150654#M11661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to read all the feature classes from SDE database A and apply all the privileges to the same feature class in SDE database B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class=""&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;env&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;workspace&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;"c:/base"&lt;/SPAN&gt;&lt;SPAN class=""&gt;# Use the ListFeatureClasses function to return a list of&lt;/SPAN&gt;&lt;SPAN class=""&gt;#&amp;nbsp; shapefiles.&lt;/SPAN&gt;&lt;SPAN class=""&gt;featureclasses&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;ListFeatureClasses&lt;/SPAN&gt;&lt;SPAN class=""&gt;()&lt;/SPAN&gt;&lt;SPAN class=""&gt;# Copy shapefiles to a file geodatabase&lt;/SPAN&gt;&lt;SPAN class=""&gt;for&lt;/SPAN&gt; &lt;SPAN class=""&gt;fc&lt;/SPAN&gt; &lt;SPAN class=""&gt;in&lt;/SPAN&gt; &lt;SPAN class=""&gt;featureclasses&lt;/SPAN&gt;&lt;SPAN class=""&gt;:
&amp;nbsp; ??? How do I get the current privileges for this FC ??
&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:06:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/apply-sde-privileges-to-another-fc/m-p/150654#M11661</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2021-12-12T16:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: apply sde privileges to another FC</title>
      <link>https://community.esri.com/t5/python-questions/apply-sde-privileges-to-another-fc/m-p/150655#M11662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;before you go too far with providing code samples, yours is not readable in its current form&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" href="https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting"&gt;Code Formatting the Basics ++&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;will get you started and you haven't indicated how much arcpy you are familiar with and why you have to do this via code in the first place, and can you accomplish what you want to do manually?&amp;nbsp; If you have a current workflow that uses tools in arctoolbox, then the coding is simple.&amp;nbsp; Processes, methods and properties that don't exist in arctoolbox can be accessed &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy/what-is-arcpy-.htm"&gt;&lt;STRONG&gt;through arcpy&lt;/STRONG&gt;&lt;/A&gt;... some, but not all.&amp;nbsp; So if you could fill in the gaps, that would be great&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Oct 2017 21:43:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/apply-sde-privileges-to-another-fc/m-p/150655#M11662</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-10-10T21:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: apply sde privileges to another FC</title>
      <link>https://community.esri.com/t5/python-questions/apply-sde-privileges-to-another-fc/m-p/150656#M11663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jose,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at this thread in GIS Stack Exchange:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://gis.stackexchange.com/questions/73991/checking-current-user-privileges-for-an-sde-dataset-with-python-arcpy" title="https://gis.stackexchange.com/questions/73991/checking-current-user-privileges-for-an-sde-dataset-with-python-arcpy"&gt;Checking current user privileges for an SDE dataset with Python/arcpy - Geographic Information Systems Stack Exchange&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's a nice function that will return a python dictionary showing the roles having view and edit permissions given a certain SDE connection, DB owner, and table name. Assuming the feature class names in sde1 are the same as in sde2, you could:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Use&amp;nbsp;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/arcpy/functions/listfeatureclasses.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/functions/listfeatureclasses.htm"&gt;ListFeatureClasses&lt;/A&gt;&amp;nbsp;to list all the feature classes in sde1&lt;/LI&gt;&lt;LI&gt;Use the function linked above to get a list of the viewers and editors for that dataset&lt;/LI&gt;&lt;LI&gt;Use&amp;nbsp;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/change-privileges.htm" title="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/change-privileges.htm"&gt;Change Privileges&lt;/A&gt;&amp;nbsp;to apply those same permissions to the dataset in sde2&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The key things would be to parse the feature class names to separate the owner and table name (they are in the format OWNER.TABLENAME), read the lists of viewers and editors out of the dictionary returned by the get_privileges function, and successfully pass the names to the right parameter of the Change Privileges tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Micah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Oct 2017 22:43:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/apply-sde-privileges-to-another-fc/m-p/150656#M11663</guid>
      <dc:creator>MicahBabinski</dc:creator>
      <dc:date>2017-10-10T22:43:08Z</dc:date>
    </item>
  </channel>
</rss>

