Click or drag to resize

PortalItemShareWithGroupsAsync Method (IEnumerablePortalGroup)

Shares this PortalItem with the specified list of PortalGroup. This Method is available only to authenticated users.

Namespace:  Esri.ArcGISRuntime.Portal
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.6.0.0
Syntax
C#
public Task<IEnumerable<PortalGroup>> ShareWithGroupsAsync(
	IEnumerable<PortalGroup> groups
)

Parameters

groups
Type: System.Collections.GenericIEnumerablePortalGroup
The collection of groups to share the item with.

Return Value

Type: TaskIEnumerablePortalGroup
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 null/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).

See Also