Method ShareWithAsync
ShareWithAsync(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.
Declaration
public Task ShareWithAsync(bool everyone, bool organization)
Parameters
Type | Name | Description |
---|---|---|
Boolean | everyone | 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. |
Boolean | organization | If true, this item will be shared with the organization. If false, the item will not be shared with the organization. |
Returns
Type | Description |
---|---|
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.
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.15 |
ShareWithAsync(Boolean, Boolean, CancellationToken)
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.
Declaration
public Task ShareWithAsync(bool everyone, bool organization, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Boolean | everyone | 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. |
Boolean | organization | If true, this item will be shared with the organization. If false, the item will not be shared with the organization. |
CancellationToken | cancellationToken | A CancellationToken with which to cancel the operation if required. |
Returns
Type | Description |
---|---|
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.
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 |