ISAWHAppObject::GetFileRight
Description
Retrieves the access rights that are granted for the current logged in user.
Syntax
long GetFileRight(
BSTR FileName,
ISAWHRight* Right,
VARIANT_BOOL* Cancelled,
BSTR ResultDescription,
);
Parameters
FileName
[in] Specifies the full name of the file.
Right
[out] Specifies the current user's access rights to the file.
Cancelled
[out] If the method fails, returns whether the operation is cancelled.
ResultDescription
[out] Returns the description of the return value. If the method succeeds, returns
'Completed'. If the method fails, returns the description of the error.
Return Value
If the method succeeds, returns 0. If the method fails, returns other error codes.
See Also
Sample
VB Sample:
Dim WithEvents sdkObject As SAWHSDKLib.SAWHAppObject Set sdkObject = New SAWHSDKLib.SAWHAppObject Private Sub GetFileRight_Click() Dim Cancelled As Boolean Dim ResultDescription As String Dim Right As New SAWHRight Dim FileName As String FileName = "$/FileName.txt" Dim ResultValue As Long ResultValue = sdkObject.GetFileRight(FileName, Right, Cancelled, ResultDescription) If ResultValue <> 0 Then MsgBox "Failed to get the access rights of the file." End If Dim AddRight As Boolean AddRight = Right.HasRightOf(Enum_AddRight) End Sub |