PortalItemShareWithGroupsAsync Method (IEnumerablePortalGroup)
public Task<IEnumerable<PortalGroup>> ShareWithGroupsAsync( IEnumerable<PortalGroup> groups )
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:
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).