ArcGIS Runtime SDK for WPF - Library Reference
ShareTaskAsync(IEnumerable<String>) Method
See Also 
ESRI.ArcGIS.Client.Portal Namespace > ArcGISPortalItem Class > ShareTaskAsync Method : ShareTaskAsync(IEnumerable<String>) Method

groupIds
The IEnumerable (aka. a collection) of Group Ids (obtained via ArcGISPortalGroup.Id values) that you want to share the item with.
Shares the ArcGISPortalItem with the specified list of ArcGISPortalGroup.Id values. This Method is available only to authenticated users.

Syntax

Visual Basic (Declaration) 
Public Overloads Function ShareTaskAsync( _
   ByVal groupIds As IEnumerable(Of String) _
) As Task(Of ShareItemResult)
C# 
public Task<ShareItemResult> ShareTaskAsync( 
   IEnumerable<string> groupIds
)

Remarks

In order to use the ArcGISPortalItem.ShareAsync Method, a user must be logged into the ArcGIS Online or ArcGIS Portal site with proper credentials. One way for a user to log into the portal site is via code using the IdentityManager Class.

The individual who is authenticated and logged into the portal site that desires to use the ArcGISPortalItem.ShareAsync Method to establish which Groups (via their ArcGISPortalGroup.Id values) the ArcGISPortalItem is part of MUST meet one of the following criteria:

  • The authenticated user is the owner of the ArcGISPortalItem.
  • The authenticated user is the Administrator of the Organization to which the ArcGISPortalItem belongs.
  • The ArcGISPortalItem has its PortalAccess value of Public and the authenticated user is the owner of the Group. Note: the ArcGISPortalItem may not have been created/owned by the authenticated user; it is only important that the ArcGISPortalItem be Public, no matter who created/owns the ArcGISPortalItem.
  • The ArcGISPortalItem has its PortalAccess value of Public and the authenticated user is the Administrator of the Organization to which Group belongs. Note: the ArcGISPortalItem may not have been created/owned by the authenticated user; it is only important that the ArcGISPortalItem be Public, no matter who created/owns the ArcGISPortalItem.

NOTE: Setting the first parameter (groupIds) of the ArcGISPortalItem.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 ArcGISPortalItem. The way to remove existing Group values from the ArcGISPortalItem is to use the ArcGISPortalItem.UnshareTaskAsync Method.

Using this version of the ArcGISPortalItem.ShareAsync only modifies Groups for the PortalAccess level of Shared. If it is desired to add or change the other PortalAccess levels for the ArcGISPortalItem, consider using the other version: ArcGISPortalItem.ShareTaskAsync.

Parameters

groupIds
The IEnumerable (aka. a collection) of Group Ids (obtained via ArcGISPortalGroup.Id values) that you want to share the item with.

Requirements

Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7, Windows 8

See Also

© ESRI, Inc. All Rights Reserved.