<?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: How to duplicate privileges from one SDE feature class to another with arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/701773#M54376</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any enhancements you would like to see, you can post the idea on ESRI's &lt;A href="http://ideas.arcgis.com/"&gt;ArcGIS Ideas&lt;/A&gt; page.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Aug 2014 11:32:52 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2014-08-05T11:32:52Z</dc:date>
    <item>
      <title>How to duplicate privileges from one SDE feature class to another with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/701768#M54371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a simple way to duplicate privileges from a SDE feature class to another one? The szenario is a nightly update process which builds an updated featureclass FC_new, deletes FC and renames FC_new to FC. Before deleting FC, the privileges for different SDE roles/users should be duplicated from FC to FC_new. Otherwise, they are lost.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there are any database-related solutions, they are also welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I am using SQL Server and ArcSDE 10.2.2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 13:11:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/701768#M54371</guid>
      <dc:creator>StefanOffermann</dc:creator>
      <dc:date>2014-08-04T13:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to duplicate privileges from one SDE feature class to another with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/701769#M54372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can include the &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//0017000000n3000000http://"&gt;Change Privileges&lt;/A&gt; function in your script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 13:15:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/701769#M54372</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2014-08-04T13:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to duplicate privileges from one SDE feature class to another with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/701770#M54373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jake, thanks for this function, I can use it to write the privileges. But how can I read the existing privileges from the existing feature class? I havent found a function for that. I hoped the Describe-function can help me, but I could not find a Describe object containing the privileges of SDE tables / feature classes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 15:44:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/701770#M54373</guid>
      <dc:creator>StefanOffermann</dc:creator>
      <dc:date>2014-08-04T15:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to duplicate privileges from one SDE feature class to another with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/701771#M54374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//002z00000021000000http://"&gt;ArcSDESQLExecute&lt;/A&gt; function to execute the below SQL query to find the privileges for each user:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14071718665136092 jive_text_macro" jivemacro_uid="_14071718665136092"&gt;
&lt;P&gt;select permission_name, pr.name&lt;/P&gt;
&lt;P&gt;from sys.database_permissions pe&lt;/P&gt;
&lt;P&gt;join sys.database_principals pr on pe.grantee_principal_id = pr.principal_id&lt;/P&gt;
&lt;P&gt;where pe.class = 1 &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and pe.major_id = object_id('&amp;lt;owner&amp;gt;.&amp;lt;feature class name')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and pe.minor_id = 0;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will want to replace '&amp;lt;owner&amp;gt;.&amp;lt;feature class name&amp;gt;'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14071718619781954" jivemacro_uid="_14071718619781954"&gt;
&lt;P&gt;import arcpy&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;sde_conn = arcpy.ArcSDESQLExecute(r"Database Connections\DBO@SQLSERVER.sde")&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;sql_statement = "select permission_name, pr.name from sys.database_permissions pe join sys.database_principals pr on pe.grantee_principal_id = pr.principal_id where pe.class = 1 and pe.major_id = object_id('vector.AIRPORTS') and pe.minor_id = 0;"&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;sde_return = sde_conn.execute(sql_statement)&lt;/P&gt;
&lt;P&gt;for row in sde_return:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "User:&amp;nbsp; " + row[1] + "\t Privilege:&amp;nbsp; " + row[0]&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 17:05:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/701771#M54374</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2014-08-04T17:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to duplicate privileges from one SDE feature class to another with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/701772#M54375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the code! I will try it. Although it would be quite nice if the geodatabase administration toolbox would also contain a GP tool to read privileges from a dataset, accordingly to Change Privileges tool.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2014 05:18:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/701772#M54375</guid>
      <dc:creator>StefanOffermann</dc:creator>
      <dc:date>2014-08-05T05:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to duplicate privileges from one SDE feature class to another with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/701773#M54376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any enhancements you would like to see, you can post the idea on ESRI's &lt;A href="http://ideas.arcgis.com/"&gt;ArcGIS Ideas&lt;/A&gt; page.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2014 11:32:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/701773#M54376</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2014-08-05T11:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to duplicate privileges from one SDE feature class to another with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/701774#M54377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the easiest way would be to place the updated FC into a feature dataset where the user/role privileges are constant and apply to all FC's it contains. If using a feature dataset isn't possible then I would look into the Change Privilege GP tool. In this GP tool you can configure the privileges you want to assign to the user/roles on the new FC. Since its a GP tool you can run it in batch if there are multiple user/roles you need to configure. Scripting this in ArcPy would be an option as well. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2014 16:22:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/701774#M54377</guid>
      <dc:creator>AndyOmmen</dc:creator>
      <dc:date>2014-08-05T16:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to duplicate privileges from one SDE feature class to another with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/701775#M54378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My solution for our customer is to administer the privileges in a CSV-file. When updating the feature classes, the privileges a read from the file (not from the existing feature classes) and set via Change Privilege using a python script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Aug 2014 09:21:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/701775#M54378</guid>
      <dc:creator>StefanOffermann</dc:creator>
      <dc:date>2014-08-06T09:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to duplicate privileges from one SDE feature class to another with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/701776#M54379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good hint to use feature datasets! Unfortunately, feature datasets are not used in our case.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Aug 2014 09:22:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/701776#M54379</guid>
      <dc:creator>StefanOffermann</dc:creator>
      <dc:date>2014-08-06T09:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to duplicate privileges from one SDE feature class to another with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/1197278#M65092</link>
      <description>&lt;P&gt;I Tried your requests, but with no success...&lt;/P&gt;&lt;P&gt;On SQL Server requests written in the article&amp;nbsp;&lt;A href="https://sqlserverguides.com/sql-server-user-permissions/" target="_blank" rel="noopener"&gt;https://sqlserverguides.com/sql-server-user-permissions/&lt;/A&gt;&amp;nbsp;worked for me.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 09:39:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-duplicate-privileges-from-one-sde-feature/m-p/1197278#M65092</guid>
      <dc:creator>Polesig</dc:creator>
      <dc:date>2022-07-29T09:39:35Z</dc:date>
    </item>
  </channel>
</rss>

