Click or drag to resize

PortalItemShareWithAsync Method (Boolean, Boolean)

Shares the portal item with everyone or just with the user's organization. If both 'everyone' and 'organization' arguments are true, the item will be shared with everyone (Public). If both 'everyone' and 'organization' arguments are false, the item will be made private, unless the item has been shared with one or more groups. In that case, the items Access property will be set to Shared. The groups an item has been shared with are not affected by this method. 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 ShareWithAsync(
	bool everyone,
	bool organization
)

Parameters

everyone
Type: SystemBoolean
If true, this item will be shared with everyone, for example, it will be publicly accessible. If false, the item will not be shared with the public.
organization
Type: SystemBoolean
If true, this item will be shared with the organization. If false, the item will not be shared with the organization.

Return Value

Type: Task
The task object representing the asynchronous share operation.
Remarks

In order to use ShareWithAsync(Boolean, Boolean) a user must be logged into the portal site with proper credentials.

The individual who is authenticated and logged into the portal site that desires to use ShareWithAsync(Boolean, Boolean) 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.
See Also