<?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: ArcGIS API for Python GIS module - User object properties - check if user is disabled in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1039601#M5783</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/167692"&gt;@DavidPike&lt;/a&gt;&amp;nbsp;one of the devs resolved the bug, said it should hit the API docs w/in the next week.&lt;/P&gt;</description>
    <pubDate>Tue, 23 Mar 2021 00:18:48 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2021-03-23T00:18:48Z</dc:date>
    <item>
      <title>ArcGIS API for Python GIS module - User object properties - check if user is disabled</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1031470#M5623</link>
      <description>&lt;P&gt;Portal 10.6.1, running from IDE, GIS module&amp;nbsp; -&amp;nbsp;class arcgis.gis.User(gis, username, userdict=None)&lt;/P&gt;&lt;P&gt;I'm testing some Python API functionality to automate some listing of users, groups, access etc. and wanted to programmatically assess users which have had their access to the Portal disabled.&lt;/P&gt;&lt;P&gt;This is part of a larger aim, but at the moment I just want to be able to test if a user has been disabled or not, when that works, I'm happy with the rest of the coding.&amp;nbsp;&lt;/P&gt;&lt;P&gt;using the API reference for the User class-&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/api-reference/1.6.1/arcgis.gis.toc.html#user" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/1.6.1/arcgis.gis.toc.html#user&lt;/A&gt;&lt;/P&gt;&lt;P&gt;the 'disabled' property when queried seems to return the correct True/False on my test accounts - although the documentation (also for the REST API) states - disabled - 'disables access to the organisation by the user')&amp;nbsp;&lt;/P&gt;&lt;P&gt;I seem to be getting the correct boolean returned but I just wanted to be sure, as the documentation is a bit weak or misleading on this one (something I've found consistently across the API documentation).&lt;/P&gt;&lt;P&gt;trying the disable() method just to test it out also doesn't work.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#connect to portal, it connects fine
gis = GIS(url, username, password)
#search for user testeditor2
user = gis.users.search(query="username: testeditor2")

#check if user is disabled
print(user[0].disabled)
#returns False

#access testeditor2 from user list index 0 and try disable method
user[0].disable()
#returns
#File "C:\Users\username\.conda\envs\py377\lib\urllib\request.py", line 649, #in http_error_default
    #raise HTTPError(req.full_url, code, msg, hdrs, fp)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 13:46:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1031470#M5623</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-03-01T13:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS API for Python GIS module - User object properties - check if user is disabled</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1031489#M5624</link>
      <description>&lt;P&gt;Running in 10.8.1, I also receive an error when attempting to call &lt;STRONG&gt;disable()&lt;/STRONG&gt; on individual accounts. I am able to accomplish the task using the bulk operation &lt;STRONG&gt;arcgis.gis.UserManager.diable_users().&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Oddly, checking &lt;STRONG&gt;user.disabled&lt;/STRONG&gt; still returned "False" on my test accounts initially after the bulk action. It updated after a couple of minutes, as though the bulk action was asynchronous.&lt;/P&gt;&lt;P&gt;Once bulk-disabled, using &lt;STRONG&gt;enable()&lt;/STRONG&gt; on a per-user basis worked just fine. I suspect this is a bug.&lt;/P&gt;&lt;P&gt;EDIT: Doesn't even work from the rest directory, either. (.../portal/sharing/rest/community/users/johndoe/disable)&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 14:30:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1031489#M5624</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-03-01T14:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS API for Python GIS module - User object properties - check if user is disabled</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1031498#M5625</link>
      <description>&lt;P&gt;Glad it's not just me - are we in the same mindset that user.disabled is a boolean property for the user's disabled status - which has a poor description?&lt;/P&gt;&lt;P&gt;Is this the right syntax for the bulk op?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcgis.gis.UserManager.disable_users(["testeditor2"])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks J&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 14:45:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1031498#M5625</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-03-01T14:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS API for Python GIS module - User object properties - check if user is disabled</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1031517#M5627</link>
      <description>&lt;P&gt;Yeah, disabled is a boolean property. I hadn't noticed the API docs before now, but it does look like they've got the method description listed next to the property. I put in an issue on their GitHub repo to get it fixed.&lt;/P&gt;&lt;P&gt;And yes, the syntax is either a list of username strings or a selection of users returned from something like &lt;STRONG&gt;UserManager.search()&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 15:16:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1031517#M5627</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-03-01T15:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS API for Python GIS module - User object properties - check if user is disabled</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1031520#M5628</link>
      <description>&lt;P&gt;Cheers J&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 15:22:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1031520#M5628</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-03-01T15:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS API for Python GIS module - User object properties - check if user is disabled</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1039601#M5783</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/167692"&gt;@DavidPike&lt;/a&gt;&amp;nbsp;one of the devs resolved the bug, said it should hit the API docs w/in the next week.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 00:18:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1039601#M5783</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-03-23T00:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS API for Python GIS module - User object properties - check if user is disabled</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1040094#M5796</link>
      <description>&lt;P&gt;Wow that's exceptionally fast.&amp;nbsp; Thanks for your help and insight J.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 10:14:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1040094#M5796</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-03-24T10:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS API for Python GIS module - User object properties - check if user is disabled</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1075293#M6302</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/167692"&gt;@DavidPike&lt;/a&gt;,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/278"&gt;@AndrewChapkowski&lt;/a&gt;&amp;nbsp;or&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/254682"&gt;@RohitSingh2&lt;/a&gt;&amp;nbsp;am I missing something here? user.disable() is clearly documented as a method that can be used to disable a user's login access: &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.User.disable" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.User.disable&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Yet the following code:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;users = [user for user in gis.users.search(query="username: testuser")]
for user in users:
    print("Disabling " + user.fullName)
    user.disable()&lt;/LI-CODE&gt;&lt;P&gt;results in&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&amp;lt;ipython-input-107-0490e44c9381&amp;gt; in &amp;lt;module&amp;gt;
      1 users = [user for user in gis.users.search(query="username: testuser")]
      2 for user in users:
      3         print("Disabling " + user.fullName)
----&amp;gt; 4         user.disable()

TypeError: 'bool' object is not callable&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 02 Jul 2021 18:40:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1075293#M6302</guid>
      <dc:creator>JohnMDye</dc:creator>
      <dc:date>2021-07-02T18:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS API for Python GIS module - User object properties - check if user is disabled</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1075299#M6303</link>
      <description>&lt;P&gt;What you're missing is that this thread was initially posted in March. It has since been resolved.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-python-api/issues/933" target="_blank"&gt;https://github.com/Esri/arcgis-python-api/issues/933&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 18:56:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1075299#M6303</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-07-02T18:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS API for Python GIS module - User object properties - check if user is disabled</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1075829#M6326</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;thanks for the response. I realize the thread was resolved, that was why I asked on the same thread because if its resolved, then I must be doing something wrong.&lt;/P&gt;&lt;P&gt;Last time I checked, properties are supposed to tell you something about an object's state, while python methods are supposed actually do something. What I don't understand is why there is a documented disable() method on the user object.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The disable method is documented in the latest version of the API documentation which I linked to above. Either I am doing something wrong in my code above, or this disable() method on the user object is not functional. I'm just trying to figure out which.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 13:24:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-gis-module-user-object/m-p/1075829#M6326</guid>
      <dc:creator>JohnMDye</dc:creator>
      <dc:date>2021-07-06T13:24:28Z</dc:date>
    </item>
  </channel>
</rss>

