|
POST
|
Is there a way to pull a list of all possible role privileges that can be assigned to custom roles? I know there are tables in the documentation, and I can pull lists of privileges from custom roles, but I'd like to be able to programmatically pull a list from the API given that new ones are occasionally added. And while I could scrape the web page tables, I'd rather not be at the mercy of an unexpected format change to that page. My goal is to build a list of default privileges programmatically for the default admin, publisher, and user roles, which can't be read in a role object the same way that custom roles or the Viewer and Data Editor roles can. I see that all privileges are tagged with admin, publisher, or user so if I can pull a full list then I can assign them via those tags. This would also be handy if you are trying to create custom roles and want to pull all user level privileges, for example, and then add a couple other privileges specifically by name.
... View more
03-26-2026
09:18 AM
|
0
|
3
|
1294
|
|
POST
|
@BHK I know this is ancient, but in case anyone else comes across this while surfing the web for answers—the default Admin, Publisher, and User roles are handled differently. Not sure why, probably legacy stuff from when ArcGIS Online was first launched. While custom roles and later default Esri roles (Viewer, Data Editor) have a random 16-character id and a RoleObject you can read, the ID for these three original roles are org_admin, org_publisher, and org_user. They behave differently and you can't pull the same info on them through gis.users.roles.all() as you can with the others, which have associated role objects. You can see these if you pull up a specific user with one of these three roles and check their roleid (see example below). If you want to pull the privileges for those 3 default roles, you can pull an existing user who has that account type and get it from there. I don't know of a way to get it without going through an existing user who has those default roles from arcgis import gis
from arcgis.gis import GIS
gis = GIS(url = 'your_portal_url', username = 'your_username', password = 'your_password')
### Inspect org roleIds, remove the query to see all roles, and how these defaults compare with custom roles
for user in gis.users.search(query="role:org_admin"):
print(user.roleId)
### If you try to get the roleobject for one of these default roles, you'll get None in return. Whereas if you put in the id of a custom role (like you are in your example) you can pull name, description, privileges, etc.
roleobject = gis.users.roles.get_role('org_admin')
print(roleobject)
# Get all possible privileges via admin
for user in gis.users.search(query="role:org_admin", max_users=1):
full_priv_list = user.privileges
# Get privileges for all 3 default roles
primary_default_roles = ['org_admin', 'org_publisher', 'org_user']
for dr in primary_default_roles:
for user in gis.users.search(query = f'role:{dr}', max_users = 1):
print(user.roleId)
priv_list = user.privileges
print(priv_list)
... View more
03-26-2026
09:01 AM
|
0
|
0
|
286
|
|
POST
|
@KadeSmith thanks, appreciate the quick response, too. It'd be nice if we could use Email or another more distinct field in place of Known As. Or if the app had some sort of logic to suggest matches based on names that are similar, like geocoding results.
... View more
03-19-2026
08:15 AM
|
0
|
0
|
361
|
|
POST
|
@KadeSmith I know this was ages ago, but did you ever figure this out? There doesn't seem to be much documentation on how placeholder matching works. I'm able to get a pop-up saying that matches have been found, but then when telling it to replace the placeholders they simply disappear and the seat assignment doesn't get replaced with the real occupant record.
... View more
03-19-2026
07:50 AM
|
0
|
2
|
364
|
|
IDEA
|
The Space Planner allows you to allocate spaces to specific groups, based on values in the ORG_LEVEL_1 field of the Occupants layer. For larger orgs, it could be beneficial to have multiple fields to work with. ORG_LEVEL_1 might be Department and ORG_LEVEL_2 might be Team. In some cases, the organization might want to allocate some spaces for use by any Team in the Department, while other spaces are only allocated to a specific Team. Related to this idea, it would then also be nice if the Space Planner allowed you to choose what field(s) the Allocation functionality uses for increased flexibility, rather than requiring the use of the ORG_LEVEL_1 field, ORG_LEVEL_2 field, etc.. For visualization purposes, it would be nice to be able to toggle the map visualization based on those different levels, and to search/filter for allocated units based on these multiple fields. While our org specifically would like to see at least three levels, even just allowing for one additional level of organization using the default ORG_LEVEL_2 field would be a big help.
... View more
03-16-2026
01:51 PM
|
0
|
0
|
272
|
|
IDEA
|
In the Units feature class, the Assignment Type field currently has a value for "Not Assignable", which prevents users in Space Planner from assigning staff to that unit. Great for common areas that would never be assigned to somebody, and helps reduce error. It would be helpful if there was a similar solution for Allocations. Currently, any Unit can be allocated to an organization area, but there are many spaces like stairways, lobbies, rest rooms, etc. that I'm sure most orgs would never want or need to allocate to a specific team. Instead, these areas can just make selecting actual workspaces to allocate more cumbersome. For example, if you have an open office floor plan and want to select a large group of desks/cubicles within it, without selecting the open office space itself. See example below. If I wanted to reallocate all these desks to a new organization areas, I need to make multiple precise selections or know the keyboard shortcut to remove from a selection to grab all these desks without grabbing the space around it, or any of the hallways, etc. Making those spaces unallocable would help streamline and simplify the workflow.
... View more
03-13-2026
08:19 AM
|
0
|
0
|
224
|
|
POST
|
Ah that makes sense, I didn't catch that in the original code you shared. Moving the reenable sync step to after the append was almost certainly it. Glad you were able to figure it out.
... View more
03-12-2026
11:42 AM
|
0
|
0
|
565
|
|
POST
|
Thank you @PeterKnoop , that's good to know. But yes would be great if Esri had a complete list somewhere. For example we have the odd Indoors user type, but most probably don't have that in their subscription. Or would be nice to get definitive info on how Lite (Temporary) and Standard (Temporary) differ. Edit: gis.properties.subscriptionInfo.userLicenseTypes isn't being recognized and I don't see it in the API documentation. And digging around I found subscription_information, but it sounds like that only works for ArcGIS Online, not an Enterprise Portal. I didn't specify Enterprise vs AGO as I thought it would be the same in the API, but apparently not.
... View more
03-06-2026
09:32 AM
|
0
|
0
|
726
|
|
POST
|
After posting this, realized we did have access to those account types, just had to create new accounts that used them. For anyone else who stumbles across this, I believe the new list includes what's below. There may be others missing , though. Would like to see a full list in that documentation. ['creatorUT',
'editorUT',
'fieldWorkerUT',
'GISProfessionalStdUT',
'GISProfessionalAdvUT',
'IndoorsUserUT',
'liteTemporaryUT', 'standardTemporaryUT,
'viewerUT'] GISProfessionalStdUT seems to have been repurposed for Professional, and GISProfessionalAdvUT for Professional Plus. I'm guessing the two Temporary account types are for accounts that were created but are still waiting on the user to accept the invite? But unsure on Lite vs Standard. editorUT and fieldworkerUT are for Contributer and Mobile Worker, respectively.
... View more
03-06-2026
09:11 AM
|
0
|
0
|
732
|
|
POST
|
I know you're disabling it mid-step, but can you test it with a duplicate feature layer that doesn't have sync enabled at all? Sounds like it is still storing previous versions or a history of previous edits somewhere, and if you're doing a full truncate/append that's a lot of "edits". When I need to do full overwrites I either use the .update() method to replace the whole file, or use spatially enabled dataframes (SEDF) and .edit_features(adds='your SEDF'). Something like the examples below. Could try one of these as an alternative to append() . ### Update Hosted Feature Layers Examples
from arcgis.gis import GIS
from arcgis.features import FeatureLayerCollection
updated_data = r'this_is_a_path_to_file.csv' # path to your updated dataset, the file type must match whatever the service was published with
itemid = '' # the itemid for the hosted feature service you want to update in ArcGIS Online, you can get it off item page in AGO
portal_url = '' # "https://example.maps.arcgis.com"
user = '' # AGO username
pw = '' # AGO password
### Log in to ArcGIS Online account
gis = GIS(portal_url, user, pw)
un = gis.properties.user.username
print(f'\nLogged in as {un} on {portal_url} \n')
#############################################################################
### Example 1 (Overwrite directly from local file)
# If you published to AGO from a local file (csv, fgdb, etc.), this is the simplest way to overwrite
# The new data must have the same filename and file type, and FGDBs must be zipped
hostedfeature = gis.content.get(itemid)
flayer = FeatureLayerCollection.fromitem(hostedfeature)
flayer.manager.overwrite(updated_data)
print("Hosted feature layer updated with the latest and greatest")
# That is the barebones method, but you can update lots of other stuff too, for example the description, title, etc.
# https://developers.arcgis.com/rest/users-groups-and-items/common-parameters/
item_properties={
"description":"Here is my description, isn't it great",
"title":"Great Item Title"
}
hostedfeature.update(item_properties)
# Or the thumbnail
thumb = r'path_to_some_picture.jpg' # can also use a image url
hostedfeature.update(thumbnail=thumb)
# Or you can disable and enable settings, like Sync
syncoff = {"capabilities": "Query, Extract"}
hostedfeature.manager.update_definition(syncoff)
syncon = {"capabilities": "Query, Extract, Sync"}
hostedfeature.manager.update_definition(syncon)
# https://developers.arcgis.com/python/latest/samples/overwriting-feature-layers/#:~:text=updated_capitals_csv%27%2C%20csv_file_name))-,Overwrite%20the%20feature%20layer,-Let%20us%20overwrite
#############################################################################
### Example 2 (Go the edit route with a full truncate and append)
# You can do this either from a regular pandas dataframe if it's a table, a spatially enabled dataframe if there is geometry, or from a featureset
# If you are adding more than 1000 features you want to chunk it out
import pandas as pd
import os
hostedfeature = gis.content.get(itemid).layers[0] # if you have a hosted table you can use .tables[0] instead
hostedfeature.manager.truncate()
local_featureclass = os.path.join(r"path to a file geodatabase .gdb", "MyFeatureClass")
sedf = pd.DataFrame.spatial.from_featureclass(local_featureclass)
n = 1000
for i in range(0, len(sedf), n):
chunk = sedf[i:i+n]
result = hostedfeature.edit_features(adds=chunk)
print(f'added items {i+1}-{i+n}...')
... View more
03-06-2026
08:47 AM
|
0
|
2
|
651
|
|
POST
|
I'm writing a script where I'd like to know all the potential user types provided by gis.users.license_types. The example list in the documentation is out of date, and doesn't include the newer types like Professional and Professional Plus (instead, it still shows Professional Basic/Standard/Advanced, Storyteller, etc. which were all retired). The org I'm working with doesn't have licenses for all possible types yet (so I can't see what the ids would look like if they were to get them in the future. Can anyone help me out? I believe the new list would look something like the one below, but want to confirm: ['creatorUT',
'editorUT',
'fieldWorkerUT',
'GISProfessional'(?),
'GISProfessionalPlus'(?),
'IndoorsUserUT',
'liteUT',
'viewerUT']
... View more
03-06-2026
08:25 AM
|
1
|
3
|
757
|
|
POST
|
Are you sure you Published it? "Saving" the app isn't enough. A "View" button should appear on that page above "Edit" once you choose "Publish" in the editor (top right of the builder). There will also be a direct URL generated on that Item Details page, on the right side under Details.
... View more
03-02-2026
01:55 PM
|
0
|
1
|
408
|
|
POST
|
Thanks for the response @Katie_Clark . I don't necessarily need the usage (although this is nice to know, too). Ultimately I'm just trying to determine what licenses users have access to, via the API. The provisions property of a User returns add-on licenses in ArcGIS Online, but it doesn't show if a user has access to ArcGIS Pro through their account license (like a Creator account comes with ArcGIS Pro Basic). Running something like gis.admin.license.get('ArcGIS Pro') or gis.admin.license.all() both return empty lists, too (Enterprise 11.5). Running your usage_reports example on an Enterprise Portal returns and error that PortalAdminManager doesn't have an attribute call usage_reports, so that seems like it might be for ArcGIS Online only Edit (3/6/2026): For anyone else who may come across this, I posted a comment in this other thread about what I did to get what I needed in an Enterprise Portal
... View more
02-27-2026
01:07 PM
|
0
|
0
|
842
|
|
POST
|
@JCGuarneri Did you ever figure this out? Running into the same issue. Can pull it fine via provisions property in ArcGIS Online. But that returns an empty list in Enterprise Portal (11.5), and I also get empty list using gis.admin.license.all() Edit (3/2/2026): For anyone who comes across this with the same issue, I think maybe what's happening is that user.provisions is specifically for add-on licenses that have been assigned to a user, not licenses that come inherently with an account type. For example, a Creator user type comes with ArcGIS Pro Basic (as of writing this in March 2026), it isn't manually assigned and can't be removed. What I ended up doing was looking at gis.users.license_types (which returns a dictionary of user account types in your org and all the apps/bundles/extensions that the account comes with) and pulling info from it based on the user's license id (user.userLicenseTypeId). Here is a function I wrote to pull the account's inherent ArcGIS Pro license, extensions, app bundles, and a full list of apps within those bundles. The "user" input in the function would be a user object, like you'd get from gis.users.search(). def builtin_licenser(user):
utypes = gis.users.license_types # this returns a list of dictionaries, one for each account type and containing nested dictionaries of apps/extensions
usertype = user.userLicenseTypeId # get user type id (i.e. creatorUT)
for u in utypes:
if usertype == u['id']:
prolist = []
bundlelist = []
fullapplist = []
extlist = []
for a in u['apps']: # look through apps dict
if a['type'] == 'App Bundle': # list app bundles (i.e. Essential Apps, Field Apps, etc.)
bundlelist.append(a['title'])
for app in a['apps']:
fullapplist.append(app['title'])
else:
if a['title'] == 'ArcGIS Pro': # if ArcGIS Pro is included, grab tier (entitlement)
arcpro_type = (a['title'] + ' ' + a['entitlements'][0])
prolist.append(arcpro_type)
else: # grab any other apps included that are not within the bundles
fullapplist.append(a['title'])
for e in u['extensions']: # look through extensions dict
extlist.append(e['title'])
result_dict = { # return all this info in a dict
'Pro': ', '.join(prolist),
'Bundles': ', '.join(bundlelist),
'Apps': ', '.join(fullapplist),
'Extensions': ', '.join(extlist)
}
return result_dict Hope that helps point someone else in the right direction.
... View more
02-27-2026
12:56 PM
|
0
|
0
|
749
|
|
POST
|
Did you ever figure this out? Seeing the same thing, works in ArcGIS Online but not with an Enterprise Portal (11.5). Just get an empty list. Have tried grabbing bundles too, same deal.
... View more
02-27-2026
12:54 PM
|
0
|
0
|
955
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 1 | 04-24-2026 09:14 AM | |
| 1 | 09-19-2023 08:22 PM | |
| 1 | 06-24-2022 09:52 AM | |
| 1 | 03-26-2026 12:44 PM |
| Online Status |
Offline
|
| Date Last Visited |
Wednesday
|