Web.GetObjectSharingSettings method

Given a path to an object in SharePoint, this will generate a sharing settings object which contains necessary information for rendering sharing information.

Namespace:  Microsoft.SharePoint.Client
Assembly:  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

Syntax

'Declaration
Public Shared Function GetObjectSharingSettings ( _
    context As ClientRuntimeContext, _
    objectUrl As String, _
    groupId As Integer, _
    useSimplifiedRoles As Boolean _
) As ObjectSharingSettings
'Usage
Dim context As ClientRuntimeContext
Dim objectUrl As String
Dim groupId As Integer
Dim useSimplifiedRoles As Boolean
Dim returnValue As ObjectSharingSettings

returnValue = Web.GetObjectSharingSettings(context, _
    objectUrl, groupId, useSimplifiedRoles)
public static ObjectSharingSettings GetObjectSharingSettings(
    ClientRuntimeContext context,
    string objectUrl,
    int groupId,
    bool useSimplifiedRoles
)

Parameters

  • objectUrl
    Type: System.String
    • The URL of the site, with the path of the object in SharePoint represented as query string parameters, forSharing set to 1 if sharing, and mbypass set to 1 to bypass any mobile logic. For example:

      https://contoso.com/?forSharing=1&mbypass=1&List=%7BCF908473%2D72D4%2D449D%2D8A53%2D4BD01EC54B84%7D&obj={CF908473-72D4-449D-8A53-4BD01EC54B84},1,DOCUMENT 
      
    • The URL of the SharePoint object (web, list, item) intended for sharing. For example:

      https://contoso.com/Documents/SampleFile.docx 
      
  • groupId
    Type: System.Int32

    The id value of the permissions group if adding to a group, 0 otherwise.

  • useSimplifiedRoles
    Type: System.Boolean

    Boolean value indicating whether to use the SharePoint simplified roles (Edit, View).

Return value

Type: Microsoft.SharePoint.Client.ObjectSharingSettings
A ObjectSharingSettings object.

See also

Reference

Web class

Web members

Microsoft.SharePoint.Client namespace