Friday, May 25, 2018

[Code Snippet] Find Custom Role of users that are in ArcGIS portal - ArcGIS

from arcgis.gis import *

self.portalInfo = GIS(self.portalUrl, self.userName, self.password)

self.portalUsers = self.portalInfo.users.search('')

users = self.portalUsers

roleManager = arcgis.gis.RoleManager(self.portalInfo)

roles = roleManager.all()

for user in users:

if hasattr(user,'roleId'):

for role in roles:

if(user.roleId == role.role_id):

print(user.username,user.role,role.name)

ArcGIS for Python , Python

0 comments :

Post a Comment

 

© 2011 GIS and Remote Sensing Tools, Tips and more .. ToS | Privacy Policy | Sitemap

About Me