SPFile.CanOpenFile method (Boolean, String)
Indicates whether the current user has permission to view the content of the file, specifying a level of access and an output variable to receive an ETag.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
- Type: System.Boolean
true to verify that the user can view the source for the file; otherwise, false.
- Type: System.String
A reference to a variable that receives a hash stamp that identifies the version of the file. If the user does not have permission to open the file, the variable receives a null value.
Return valueType: System.Boolean
true if the current user has permission; otherwise, false.
You can call this method before calling the OpenBinaryStream(SPOpenBinaryOptions, String, String) method.