<?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 Add permissions but no DELETE in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/add-permissions-but-no-delete/m-p/1619321#M74301</link>
    <description>&lt;P&gt;I know that I can add permissions as seen below... But this gives all EDIT permissions...&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I want ADD and UPDATE but NO DELETE...&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can this be done?&lt;/P&gt;&lt;LI-CODE lang="c"&gt;# Import system modules
import arcpy

# Set local variables
datasetName = "c:/Connections/gdb@production.sde/production.GDB.ctgFuseFeature"

# Run ChangePrivileges
arcpy.management.ChangePrivileges(datasetName, "WENDELCLARK", "GRANT", "GRANT")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 29 May 2025 16:40:56 GMT</pubDate>
    <dc:creator>kapalczynski</dc:creator>
    <dc:date>2025-05-29T16:40:56Z</dc:date>
    <item>
      <title>Add permissions but no DELETE</title>
      <link>https://community.esri.com/t5/python-questions/add-permissions-but-no-delete/m-p/1619321#M74301</link>
      <description>&lt;P&gt;I know that I can add permissions as seen below... But this gives all EDIT permissions...&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I want ADD and UPDATE but NO DELETE...&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can this be done?&lt;/P&gt;&lt;LI-CODE lang="c"&gt;# Import system modules
import arcpy

# Set local variables
datasetName = "c:/Connections/gdb@production.sde/production.GDB.ctgFuseFeature"

# Run ChangePrivileges
arcpy.management.ChangePrivileges(datasetName, "WENDELCLARK", "GRANT", "GRANT")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 May 2025 16:40:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-permissions-but-no-delete/m-p/1619321#M74301</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2025-05-29T16:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Add permissions but no DELETE</title>
      <link>https://community.esri.com/t5/python-questions/add-permissions-but-no-delete/m-p/1619327#M74302</link>
      <description>&lt;P&gt;According to the help&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/change-privileges.htm" target="_blank"&gt;Change Privileges (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The RDBMS equivalent commands for the Edit parameter are Update, Insert, and Delete.&lt;EM&gt; All three are granted or revoked simultaneously by the Edit parameter&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;fine-tuning doesn't appear to be accessable throught this approach&lt;/P&gt;</description>
      <pubDate>Thu, 29 May 2025 16:56:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-permissions-but-no-delete/m-p/1619327#M74302</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2025-05-29T16:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Add permissions but no DELETE</title>
      <link>https://community.esri.com/t5/python-questions/add-permissions-but-no-delete/m-p/1619328#M74303</link>
      <description>&lt;P&gt;Dang that's unfortunate&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 May 2025 17:00:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-permissions-but-no-delete/m-p/1619328#M74303</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2025-05-29T17:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Add permissions but no DELETE</title>
      <link>https://community.esri.com/t5/python-questions/add-permissions-but-no-delete/m-p/1619341#M74304</link>
      <description>&lt;P&gt;What about via the DBMS?&lt;/P&gt;</description>
      <pubDate>Thu, 29 May 2025 17:12:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-permissions-but-no-delete/m-p/1619341#M74304</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2025-05-29T17:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Add permissions but no DELETE</title>
      <link>https://community.esri.com/t5/python-questions/add-permissions-but-no-delete/m-p/1619347#M74305</link>
      <description>&lt;P&gt;The trick is to not use arcpy, like &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/167692"&gt;@DavidPike&lt;/a&gt;&amp;nbsp;suggested. I think this worked for me in the past; give it a shot?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;stateGrpDict = {
            "ak": r"[usergroup]",
            "az": r"[usergroup]",
            #...
        }
# Create Table View to grab connection information.
# This part makes more sense in context, but 
# basically i'm grabbing the name of a US State 
#from the database's name via the connection.
db = arcpy.management.MakeTableView(inTbl)[0]
con = db.connectionProperties
conDB = con["connection_info"]["database"]
conDBS = conDB[4:6]
conDS = con["dataset"]
grp = stateGrpDict.get(conDBS, None)

# Apply View, Insert, and Update privileges, but not Delete
# privileges.
# ChangePrivileges() is all or nothing.
# This way, no one can delete the records.
executor = arcpy.ArcSDESQLExecute(IN_WKSPC)
sql = f"GRANT SELECT, INSERT, UPDATE ON {conDS} TO {grp}"
executor.execute(sql)
del executor&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 May 2025 17:23:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-permissions-but-no-delete/m-p/1619347#M74305</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2025-05-29T17:23:06Z</dc:date>
    </item>
  </channel>
</rss>

