Method ShareWithGroupsAsync
ShareWithGroupsAsync(IEnumerable<PortalGroup>)
Shares this PortalItem with the specified list of PortalGroup. This Method is available only to authenticated users.
Declaration
public Task<IEnumerable<PortalGroup>> ShareWithGroupsAsync(IEnumerable<PortalGroup> groups)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<PortalGroup> | groups | The collection of groups to share the item with. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IEnumerable<PortalGroup>> | The task object representing the asynchronous share operation. The value of the task result is a collection of PortalGroup objects with which the item was NOT shared. |
Remarks
In order to use the PortalItem.ShareAsync Method, a user must be logged into the ArcGIS Online or ArcGIS Portal site with proper credentials.
The individual who is authenticated and logged into the portal site that desires to use the PortalItem.ShareAsync Method to establish which Groups (via their GroupId values) the PortalItem is part of MUST meet one of the following criteria:
- The authenticated user is the owner of the PortalItem.
- The authenticated user is the Administrator of the Organization to which the PortalItem belongs.
- The PortalItem has its PortalAccess value of Public and the authenticated user is the owner of the Group. Note: the PortalItem may not have been created/owned by the authenticated user; it is only important that the PortalItem be Public, no matter who created/owns the PortalItem.
- The PortalItem has its PortalAccess value of Public and the authenticated user is the Administrator of the Organization to which Group belongs. Note: the PortalItem may not have been created/owned by the authenticated user; it is only important that the PortalItem be Public, no matter who created/owns the PortalItem.
NOTE: Setting the first parameter (groupIds) of the PortalItem.ShareAsync to nothing does not set any existing Group values. In other words, it does not empty the list of Groups associated with the PortalItem. The way to remove existing Group values from the PortalItem is to use the UnshareAsync() method.
Using this version of the PortalItem.ShareAsync only modifies Groups for the PortalAccess level of Shared. If it is desired to add or change the other PortalAccess levels for the PortalItem, consider using the other version: ShareWithAsync(Boolean, Boolean).
Applies to
Platforms and versions
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 100.15 |
.NET 6.0 | 100.13 - 100.15 |
.NET 6.0 Windows | 100.13 - 100.15 |
.NET Framework | 100.0 - 100.15 |
.NET 5 | 100.10 - 100.12 |
.NET Core 3.1 | 100.7 - 100.12 |
Xamarin.Android | 100.0 - 100.15 |
Xamarin.iOS | 100.0 - 100.15 |
UWP | 100.0 - 100.14 |
ShareWithGroupsAsync(IEnumerable<PortalGroup>, CancellationToken)
Shares this PortalItem with the specified list of PortalGroup. This Method is available only to authenticated users.
Declaration
public Task<IEnumerable<PortalGroup>> ShareWithGroupsAsync(IEnumerable<PortalGroup> groups, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<PortalGroup> | groups | The collection of groups to share the item with. |
CancellationToken | cancellationToken | A CancellationToken with which to cancel the operation if required. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IEnumerable<PortalGroup>> | The task object representing the asynchronous share operation. The value of the task result is a collection of PortalGroup objects with which the item was NOT shared. |
Remarks
In order to use the PortalItem.ShareAsync Method, a user must be logged into the ArcGIS Online or ArcGIS Portal site with proper credentials.
The individual who is authenticated and logged into the portal site that desires to use the PortalItem.ShareAsync Method to establish which Groups (via their GroupId values) the PortalItem is part of MUST meet one of the following criteria:
- The authenticated user is the owner of the PortalItem.
- The authenticated user is the Administrator of the Organization to which the PortalItem belongs.
- The PortalItem has its PortalAccess value of Public and the authenticated user is the owner of the Group. Note: the PortalItem may not have been created/owned by the authenticated user; it is only important that the PortalItem be Public, no matter who created/owns the PortalItem.
- The PortalItem has its PortalAccess value of Public and the authenticated user is the Administrator of the Organization to which Group belongs. Note: the PortalItem may not have been created/owned by the authenticated user; it is only important that the PortalItem be Public, no matter who created/owns the PortalItem.
NOTE: Setting the first parameter (groupIds) of the PortalItem.ShareAsync to nothing does not set any existing Group values. In other words, it does not empty the list of Groups associated with the PortalItem. The way to remove existing Group values from the PortalItem is to use the UnshareGroupsAsync(IEnumerable<PortalGroup>) method.
Using this version of the PortalItem.ShareAsync only modifies Groups for the PortalAccess level of Shared. If it is desired to add or change the other PortalAccess levels for the PortalItem, consider using the other version: ShareWithAsync(Boolean, Boolean, CancellationToken).
Applies to
Platforms and versions
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 100.15 |
.NET 6.0 | 100.13 - 100.15 |
.NET 6.0 Windows | 100.13 - 100.15 |
.NET Framework | 100.0 - 100.15 |
.NET 5 | 100.10 - 100.12 |
.NET Core 3.1 | 100.7 - 100.12 |
Xamarin.Android | 100.0 - 100.15 |
Xamarin.iOS | 100.0 - 100.15 |
UWP | 100.0 - 100.14 |