Condividi tramite


SPObjectSharingInformation.GetObjectSharingInformation method

Gets information about the sharing state for a given securable object.

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

Syntax

'Declaration
Public Shared Function GetObjectSharingInformation ( _
    securableObject As SPSecurableObject, _
    excludeCurrentUser As Boolean, _
    excludeSiteAdmin As Boolean, _
    excludeSecurityGroups As Boolean, _
    retrieveAnonymousLinks As Boolean, _
    retrieveUserInfoDetails As Boolean, _
    checkForAccessRequests As Boolean, _
    retrievePermissionLevels As Boolean _
) As SPObjectSharingInformation
'Usage
Dim securableObject As SPSecurableObject
Dim excludeCurrentUser As Boolean
Dim excludeSiteAdmin As Boolean
Dim excludeSecurityGroups As Boolean
Dim retrieveAnonymousLinks As Boolean
Dim retrieveUserInfoDetails As Boolean
Dim checkForAccessRequests As Boolean
Dim retrievePermissionLevels As Boolean
Dim returnValue As SPObjectSharingInformation

returnValue = SPObjectSharingInformation.GetObjectSharingInformation(securableObject, _
    excludeCurrentUser, excludeSiteAdmin, _
    excludeSecurityGroups, retrieveAnonymousLinks, _
    retrieveUserInfoDetails, checkForAccessRequests, _
    retrievePermissionLevels)
public static SPObjectSharingInformation GetObjectSharingInformation(
    SPSecurableObject securableObject,
    bool excludeCurrentUser,
    bool excludeSiteAdmin,
    bool excludeSecurityGroups,
    bool retrieveAnonymousLinks,
    bool retrieveUserInfoDetails,
    bool checkForAccessRequests,
    bool retrievePermissionLevels
)

Parameters

  • excludeCurrentUser
    Type: System.Boolean

    Specifies whether the returned sharing information object should exclude information about the current user.

  • excludeSiteAdmin
    Type: System.Boolean

    Specifies whether the returned sharing information object should exclude information about site administrator users.

  • excludeSecurityGroups
    Type: System.Boolean

    Specifies whether the returned sharing information object should exclude security groups from the list of shared with users.

  • retrieveAnonymousLinks
    Type: System.Boolean

    Specifies whether the returned sharing information object should include information about anonymous links.

  • retrieveUserInfoDetails
    Type: System.Boolean

    Specifies whether the returned sharing information object should include additional user information.

  • checkForAccessRequests
    Type: System.Boolean

    Specifies whether to retrieve access requests information.

  • retrievePermissionLevels
    Type: System.Boolean

    Specifies whether to retrieve sharing information with permission levels. This is only applicable for document sharing in a library that has IsDocumentSharing set to true and the View and Edit role definitions exist. When passed as true and the above condition is met, it will retrieve sharing information for the document with permission levels. An example of usage would be Shared With Dialog, in which it displays permission levels for document sharing when IsDocumentSharing is enabled.

Return value

Type: Microsoft.SharePoint.SPObjectSharingInformation
An SPObjectSharingInformation object containing information about the given securable object.

See also

Reference

SPObjectSharingInformation class

SPObjectSharingInformation members

Microsoft.SharePoint namespace