I am using the source code from the API page for cloning.
Clone Portal users, groups and content | ArcGIS API for Python
My particular problem is that the user creation by default sets my "type" to "Creator". The "New Member Defaults" setting on the target portal is type:"Viewer" and role:"Viewer".
The API documentation I am following:arcgis.gis module | ArcGIS API for Python
The area I am working with:
create(username, password, firstname, lastname, email, role, description=None, provider='arcgis', idp_username=None, level=2, thumbnail=None, user_type=None, credits=- 1, groups=None, email_text=None)¶
Code being executed:
target_user = target_portal.users.create(source_user.username, password, first_name, last_name,
source_user.email, source_user.description , source_user.role)
All this runs and creates the users ("Members") in the portal. but uses the "Creator" and NOT the "Viewer" type. The source information evidences that the user is "arcgisonly" among everything else. This is a listing from the dictionary values from the output of:
source_users = source.users.search('!esri_ & !admin',max_users=260)
for user in source_users:
print(user.username + "\t:\t" + str(user.role))
for key, value in user.__dict__.items():
print(f"{key}: {value}")
aldermant@ci.janesville.wi.us : org_user
_gis: GIS @ https://maps.ci.janesville.wi.us/portal version:8.2
_portal: <arcgis.gis._impl._portalpy.Portal object at 0x0000020091F49588>
_user_id: aldermant@ci.janesville.wi.us
thumbnail: None
_workdir: C:\Users\tomlinss\AppData\Local\Temp
_hydrated: True
username: aldmant@ci.janesville.wi.us
id: 29209e609def4612998914944768e99d
fullName: Trderman
firstName: Tra
lastName: rman
preferredView: None
description: None
email: aldeant@ci.janesille.wi.us
userType: arcgisonly
idpUsername: aldeant@ci.janelle.wi.us
favGroupId: 47210944c0fc4783b1dfc0bbdb0a882a
lastLogin: -1
mfaEnabled: False
validateUserProfile: True
access: public
storageUsage: 22101499
storageQuota: 10995116277760
orgId: 0123456789ABCDEF
role: org_user
privileges: ['portal:user:joinGroup', 'portal:user:viewOrgGroups', 'portal:user:viewOrgItems', 'portal:user:viewOrgUsers', 'premium:user:demographics', 'premium:user:elevation', 'premium:user:geocode', 'premium:user:networkanalysis']
adminCategories: []
roleId: iAAAAAAAAAAAAAAA
level: 1
userLicenseTypeId: viewerUT
disabled: False
tags: []
culture: en-US
cultureFormat: us
region: None
units: english
created: 1683063913118
modified: 1683063943058
provider: enterprise
groups: [{'id': 'c5aa36caa6534a8dbf3cd6bdfff83870', 'title': 'City Employees Maps and Apps', 'isInvitationOnly': True, 'owner': 'GIS_Admin', 'description': None, 'snippet': 'City Employees Maps and Apps. Our current Geocortex Essentials City Employees website requires an individual portal user for each staff member in order to access the site.\n', 'tags': ['City Employees', 'Geocortex Essentials'], 'phone': None, 'sortField': 'title', 'sortOrder': 'asc', 'isViewOnly': False, 'thumbnail': None, 'created': 1683063248170, 'modified': 1683226178816, 'access': 'org', 'capabilities': [], 'isFav': False, 'isReadOnly': False, 'protected': True, 'autoJoin': False, 'notificationsEnabled': False, 'provider': None, 'providerGroupName': None, 'leavingDisallowed': True, 'hiddenMembers': True, 'membershipAccess': 'org', 'displaySettings': {'itemTypes': ''}, 'userMembership': {'username': 'aldermant@ci.janesville.wi.us', 'memberType': 'member'}}]
These are the setting of my source and destination portals.
source {'role': 'iAAAAAAAAAAAAAAA', 'userLicenseType': 'viewerUT', 'groups': ['e63f5cd74ea04cd691a05e4c84922236'], 'userType': None, 'apps': [], 'appBundles': []}
target {'role': 'iAAAAAAAAAAAAAAA', 'userLicenseType': 'viewerUT', 'groups': ['19c30fa791c24145ad417115fcb2bbab'], 'userType': None, 'apps': [], 'appBundles': []}
Can someone please point me to why the creation of new users is ignoring the defaults, and possible why the cloning operation is ignoring the source user type and role..
Thank you...