|
6 | 6 | "source": [
|
7 | 7 | "# Accessing and managing users\n",
|
8 | 8 | "\n",
|
9 |
| - "Managing accounts that will access an organization is a key aspect of a Web GIS deployment. Specific management for accounts varies depending upon a specific organization's [identity store](https://enterprise.arcgis.com/en/portal/latest/administer/linux/managing-access-to-your-portal.htm#GUID-7C7592BD-900B-49A3-87F9-CB346105308F). The API for Python provides functionality for managing user accounts. Automating management tasks such as provisioning licenses, privileges, creating and removing user accounts can save a great deal of time. The [`gis`](/python/api-reference/arcgis.gis.toc.html) module provides you with [`User`](/python/api-reference/api-reference/arcgis.gis.toc.html#user) and [`UserManager`](/python/api-reference/arcgis.gis.toc.html#usermanager) classes to respresent users as objects and help you accomplish the most common tasks. \n", |
| 9 | + "Managing accounts that will access an organization is a key aspect of a Web GIS deployment. Specific management for accounts varies depending upon a specific organization's [identity store](https://enterprise.arcgis.com/en/portal/latest/administer/linux/managing-access-to-your-portal.htm#GUID-7C7592BD-900B-49A3-87F9-CB346105308F). The API for Python provides functionality for managing user accounts. Automating management tasks such as provisioning licenses, privileges, creating and removing user accounts can save a great deal of time. The [`gis`](/python/api-reference/arcgis.gis.toc.html) module provides you with [`User`](/python/api-reference/arcgis.gis.toc.html#user) and [`UserManager`](/python/api-reference/arcgis.gis.toc.html#usermanager) classes to respresent users as objects and help you accomplish the most common tasks. \n", |
10 | 10 | "\n",
|
11 |
| - "As you might have observed, the API utilizes manager classes accessible from a [`GIS`](/api-reference/arcgis.gis.toc.html#gis) object through properties. For example, an instance of the [`ContentManager`](/python/api-reference/api-reference/arcgis.gis.toc.html#contentmanager) class is returned when accessing the [`content`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis.GIS.content) property on a `GIS` object. The `GIS` object employs a [`users`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis.GIS.users) property to access the [`UserManager`](/python/api-reference/api-reference/arcgis.gis.toc.html#) class for managing operations and properties of `User` objects in the organization. This pattern of using properties to access specific manager classes is typical throughout the ArcGIS API for Python. Often times in guides and samples, these properties are chained together to decrease code complexity in accessing specific methods.\n", |
| 11 | + "As you might have observed, the API utilizes manager classes accessible from a [`GIS`](/python/api-reference/arcgis.gis.toc.html#gis) object through properties. For example, an instance of the [`ContentManager`](/python/api-reference/arcgis.gis.toc.html#contentmanager) class is returned when accessing the [`content`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis.GIS.content) property on a `GIS` object. The `GIS` object employs a [`users`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis.GIS.users) property to access the `UserManager`] class for managing operations and properties of `User` objects in the organization. This pattern of using properties to access specific manager classes is typical throughout the ArcGIS API for Python. Often times in guides and samples, these properties are chained together to decrease code complexity in accessing specific methods.\n", |
12 | 12 | "\n",
|
13 |
| - "Let's explore using the API for managing `users` within a GIS organization. For additional resources to explore options for configuring users within a Web GIS deployment and the differences inherent in using different organzational deployments, see:\n", |
| 13 | + "Let's explore using the API for managing `users` within a GIS organization. For additional resources to explore options for configuring users within a Web GIS deployment and the differences inherent in using different organizational deployments, see:\n", |
14 | 14 | "\n",
|
15 | 15 | "* ArcGIS Enterprise - [Manage access to your portal](https://enterprise.arcgis.com/en/portal/latest/administer/linux/managing-access-to-your-portal.htm)\n",
|
16 | 16 | "* ArcGIS Online - [Invite and add members](https://doc.arcgis.com/en/arcgis-online/administer/invite-users.htm)"
|
|
97 | 97 | "cell_type": "markdown",
|
98 | 98 | "metadata": {},
|
99 | 99 | "source": [
|
100 |
| - "Similar to [`Item`](/python/api-reference/api-reference/arcgis.gis.toc.html#) objects, when using the Jupyter notebook IDE, you can visualize `User` objects in rich HTML representation with thumbnails and attribute information." |
| 100 | + "Similar to [`Item`](/python/api-reference/arcgis.gis.toc.html#) objects, when using the Jupyter notebook IDE, you can visualize `User` objects in rich HTML representation with thumbnails and attribute information." |
101 | 101 | ]
|
102 | 102 | },
|
103 | 103 | {
|
|
679 | 679 | "metadata": {},
|
680 | 680 | "source": [
|
681 | 681 | "### Creating a new role\n",
|
682 |
| - "Let's create a new _role_ in the organization. Use the [`create()`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis.RoleManager.create) method on the `RoleManager` class for this task. Specifically, we want a _role_ to assign to _users_ who we want to only publish tile layers. The _role_ should have a subset of _privileges_ of the default _User_ role and be able to create items, publish tile layers, join groups, and view and share items to the organization. This role will not have any administrator privileges. Let's demonstrate how to create a role. In order to assign _privileges_ to a role, let's examine the exact syntax format for individual _privileges_ using the privileges property on our _user_ object:\n", |
| 682 | + "Let's create a new _role_ in the organization. Use the [`create()`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis.RoleManager.create) method on the [`RoleManager`](/python/api-reference/arcgis.gis.toc.html#rolemanager) class for this task. Specifically, we want a _role_ to assign to _users_ who we want to only publish tile layers. The _role_ should have a subset of _privileges_ of the default _User_ role and be able to create items, publish tile layers, join groups, and view and share items to the organization. This role will not have any administrator privileges. Let's demonstrate how to create a role. In order to assign _privileges_ to a role, let's examine the exact syntax format for individual _privileges_ using the privileges property on our _user_ object:\n", |
683 | 683 | "\n",
|
684 | 684 | "> **Note:** Even though _privileges_ is not technically a property of the `User` class, once a _user_ object is initialized, the individual _privileges_ from the _role_ hydrate the _user_ object. "
|
685 | 685 | ]
|
|
850 | 850 | "metadata": {},
|
851 | 851 | "source": [
|
852 | 852 | "### Listing all the custom roles in an org\n",
|
853 |
| - "Next, let's inspect the possible values we can use for the _role_ argument. The default Administrator, Publisher, and User roles (see [Default roles](https://doc.arcgis.com/en/arcgis-online/administer/member-roles.htm#ESRI_SECTION1_C30D73392D964D51A8B606128A8A6E8F) for descriptions) are available by using `org_admin`, `org_publisher`, or `org_user` values as `role` arguments. To assign other default roles or [custom roles](https://doc.arcgis.com/en/arcgis-online/administer/member-roles.htm#ESRI_SECTION1_30C4E874B2A94ACFBDCC0F13400E5B4E), the values to use for the `role` argument are the `role_id` values returned from the [`all()`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis.RoleManager.all) method of the [`RoleManager`](/python/api-reference/arcgis.gis.toc.html#rolemanager) class. We can access a `RoleManager` object using the [`roles`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis.UserManager.roles) property on the `UserManager`:" |
| 853 | + "Next, let's inspect the possible values we can use for the _role_ argument. The default Administrator, Publisher, and User roles (see [Default roles](https://doc.arcgis.com/en/arcgis-online/administer/member-roles.htm#ESRI_SECTION1_C30D73392D964D51A8B606128A8A6E8F) for descriptions) are available by using `org_admin`, `org_publisher`, or `org_user` values as `role` arguments. To assign other default roles or [custom roles](https://doc.arcgis.com/en/arcgis-online/administer/member-roles.htm#ESRI_SECTION1_30C4E874B2A94ACFBDCC0F13400E5B4E), the values to use for the `role` argument are the `role_id` values returned from the [`all()`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis.RoleManager.all) method of the `RoleManager` class. We can access a `RoleManager` object using the [`roles`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis.UserManager.roles) property on the `UserManager`:" |
854 | 854 | ]
|
855 | 855 | },
|
856 | 856 | {
|
|
1236 | 1236 | "\n",
|
1237 | 1237 | "> **Note:** If an item's sharing level is _private_ but shared with _groups_, the receiving _user_ must have the appropriate sharing access to all groups the item is shared with.\n",
|
1238 | 1238 | "\n",
|
1239 |
| - "We'll reassign the source `Feature Layer` items about accidents in Chicago to the `tiles_pub_user` user we created earlier. We'll use the [`advanced_search()`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis.ContentManager.advanced_search) method to query for specific item titles and types, and reassign these items. You can reassign specific items to another user by calling the [`reassign_to()`](/python//api-reference/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.reassign_to) method on the `Item` object. " |
| 1239 | + "We'll reassign the source [`Feature Layer`](/python/api-reference/arcgis.features.toc.html#featurelayer) items about accidents in Chicago to the `tiles_pub_user` user we created earlier. We'll use the [`advanced_search()`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis.ContentManager.advanced_search) method to query for specific item titles and types, and reassign these items. You can reassign specific items to another user by calling the [`reassign_to()`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.reassign_to) method on the `Item` object. " |
1240 | 1240 | ]
|
1241 | 1241 | },
|
1242 | 1242 | {
|
|
0 commit comments