SPFile.CanOpenFile Method (Boolean)

Indicates whether the current user has permission to view the content of the file, specifying a level of access.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Public Function CanOpenFile ( _
    checkCanGetFileSource As Boolean _
) As Boolean
'Usage
Dim instance As SPFile
Dim checkCanGetFileSource As Boolean
Dim returnValue As Boolean

returnValue = instance.CanOpenFile(checkCanGetFileSource)
public bool CanOpenFile(
    bool checkCanGetFileSource
)

Parameters

  • checkCanGetFileSource
    Type: System.Boolean

    true to verify that the user can view the source for the file; otherwise, false.

Return Value

Type: System.Boolean
true if the current user has permission; otherwise, false.

See Also

Reference

SPFile Class

SPFile Members

CanOpenFile Overload

Microsoft.SharePoint Namespace