SPDocumentSharingManager.UpdateDocumentSharingInfo method
Allows a user to update a document's sharing info.
Namespace: Microsoft.SharePoint.Sharing
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Shared Function UpdateDocumentSharingInfo ( _
resourceAddress As String, _
userRoleAssignments As List(Of UserRoleAssignment), _
validateExistingPermissions As Boolean, _
additiveMode As Boolean, _
sendServerManagedNotification As Boolean, _
customMessage As String, _
includeAnonymousLinksInNotification As Boolean _
) As List(Of UserSharingResult)
'Usage
Dim resourceAddress As String
Dim userRoleAssignments As List(Of UserRoleAssignment)
Dim validateExistingPermissions As Boolean
Dim additiveMode As Boolean
Dim sendServerManagedNotification As Boolean
Dim customMessage As String
Dim includeAnonymousLinksInNotification As Boolean
Dim returnValue As List(Of UserSharingResult)
returnValue = SPDocumentSharingManager.UpdateDocumentSharingInfo(resourceAddress, _
userRoleAssignments, validateExistingPermissions, _
additiveMode, sendServerManagedNotification, _
customMessage, includeAnonymousLinksInNotification)
public static List<UserSharingResult> UpdateDocumentSharingInfo(
string resourceAddress,
List<UserRoleAssignment> userRoleAssignments,
bool validateExistingPermissions,
bool additiveMode,
bool sendServerManagedNotification,
string customMessage,
bool includeAnonymousLinksInNotification
)
Parameters
resourceAddress
Type: System.StringA URL pointing to a securable object (a document, folder, or the root folder of a document library).
userRoleAssignments
Type: System.Collections.Generic.List<UserRoleAssignment>A list of recipients and the roles to on which to assign them on the securable object.
- validateExistingPermissions
Type: System.Boolean
additiveMode
Type: System.BooleanA Boolean flag indicating whether the permission setting uses the additive or strict mode: true - additive; false – strict.
sendServerManagedNotification
Type: System.BooleanA flag that tells the server to generate an email notification if an Email server is configured on the SharePoint server.
customMessage
Type: System.StringA custom message to be included in the Email notification
includeAnonymousLinksInNotification
Type: System.BooleanA Boolean flag to indicate whether to include anonymous access links in notification messages: true means to include; false means not to include.
Return value
Type: System.Collections.Generic.List<UserSharingResult>
A DocumentSharingResult object that contains a user sharing result for each recipient
See also
Reference
SPDocumentSharingManager class