<?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: user.delete() call says I don't have permissions when I very much do... in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/user-delete-call-says-i-don-t-have-permissions/m-p/1599221#M11255</link>
    <description>&lt;P&gt;See the edit at the bottom of the post. Sub-Admin just doesn't cut it, even though there are delete privileges associated with the role. This was a while ago and I haven't messed with it since.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Mar 2025 21:38:27 GMT</pubDate>
    <dc:creator>SFM_TravisBott</dc:creator>
    <dc:date>2025-03-25T21:38:27Z</dc:date>
    <item>
      <title>user.delete() call says I don't have permissions when I very much do...</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/user-delete-call-says-i-don-t-have-permissions/m-p/1383172#M9661</link>
      <description>&lt;P&gt;Wondering what gives here...&lt;/P&gt;&lt;P&gt;Basic premise: I can delete users through the GUI just fine, but when attempting to call .delete() through a script I get this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Exception: You do not have permissions to access this resource or perform this operation.
(Error Code: 403)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Slightly longer: I have a script that creates community accounts in our Hub based on information gathered in a feature service through Survey123 and assigns them to groups. I am creating a last script to delete (or disable) those users if they're marked for deletion, since the project is temporary. All other aspects of this process (creating users/inviting users, adding them to and removing them from groups) has worked great. The accounts that I'm testing this on are brand new, never been logged into and don't own any groups or content.&amp;nbsp;I can delete users using the GUI just fine, but somehow the call to delete them via a script seems to fail.&lt;/P&gt;&lt;P&gt;Basic example below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;hubUsername = 'My.Username'
hubUrl = "https://OurHub.maps.arcgis.com"
hubOrg = arcgis.GIS(hubUrl, username= hubUsername)

username = 'Test.Username'
user = hubOrg.users.get(username)

# Storing the result so we can update the master table
deleteResult = user.delete()

# This also fails...
disableResult = hubOrg.users.disable_users([username])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All attempts result in the same exception that I do not have permission. However...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;me = hubOrg.users.me
me.role

#returns...
'org_admin'

me.privileges

#returns....
['features:user:edit',
 'portal:admin:assignToGroups',
 'portal:admin:createUpdateCapableGroup',
 'portal:admin:deleteUsers',
 'portal:admin:inviteUsers',
 'portal:admin:updateUsers',
 'portal:admin:viewGroups',
 'portal:admin:viewUsers',
 'portal:publisher:publishFeatures',
 'portal:user:addExternalMembersToGroup',
 'portal:user:createGroup',
 'portal:user:createItem',
 'portal:user:invitePartneredCollaborationMembers',
 'portal:user:joinGroup',
 'portal:user:joinNonOrgGroup',
 'portal:user:shareGroupToOrg',
 'portal:user:shareToGroup',
 'portal:user:shareToOrg',
 'portal:user:viewOrgGroups',
 'portal:user:viewOrgUsers',
 'premium:publisher:createNotebooks']&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on the .privileges all, and the fact that I can delete a user through the GUI, I clearly&amp;nbsp;&lt;EM&gt;have permission&lt;/EM&gt;. So....what gives?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Edit&lt;/STRONG&gt;: I was in a sub Admin role. When I had another admin bump me up to proper Admin I could delete/disable just fine. However...the privileges listed in the code snippet above still say I can delete a user, and I can delete them in the GUI....so what's the difference using the API?&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2024 00:27:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/user-delete-call-says-i-don-t-have-permissions/m-p/1383172#M9661</guid>
      <dc:creator>SFM_TravisBott</dc:creator>
      <dc:date>2024-02-17T00:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: user.delete() call says I don't have permissions when I very much do...</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/user-delete-call-says-i-don-t-have-permissions/m-p/1397960#M9785</link>
      <description>&lt;P&gt;Hey Travis,&lt;/P&gt;&lt;P&gt;This is quite unusual and sounds like there might be something defective in assigning permission to a custom role. I would recommend raising a Support case with your Esri Distributor for further investigation.&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 16:50:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/user-delete-call-says-i-don-t-have-permissions/m-p/1397960#M9785</guid>
      <dc:creator>David_McRitchie</dc:creator>
      <dc:date>2024-03-19T16:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: user.delete() call says I don't have permissions when I very much do...</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/user-delete-call-says-i-don-t-have-permissions/m-p/1588005#M11174</link>
      <description>&lt;P&gt;Did you ever figure this out?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 15:39:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/user-delete-call-says-i-don-t-have-permissions/m-p/1588005#M11174</guid>
      <dc:creator>cjms</dc:creator>
      <dc:date>2025-02-21T15:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: user.delete() call says I don't have permissions when I very much do...</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/user-delete-call-says-i-don-t-have-permissions/m-p/1599221#M11255</link>
      <description>&lt;P&gt;See the edit at the bottom of the post. Sub-Admin just doesn't cut it, even though there are delete privileges associated with the role. This was a while ago and I haven't messed with it since.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2025 21:38:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/user-delete-call-says-i-don-t-have-permissions/m-p/1599221#M11255</guid>
      <dc:creator>SFM_TravisBott</dc:creator>
      <dc:date>2025-03-25T21:38:27Z</dc:date>
    </item>
  </channel>
</rss>

