online source control
back to content
sign up free version control plan

ISAWHAppObject::GetProjectRight

Description

Retrieves the access rights that the current logged in user has to the project.

Syntax

long GetProjectRight(
        BSTR ProjectName,
        ISAWHRight* Right,
        VARIANT_BOOL* Cancelled,
        BSTR ResultDescription,
);

Parameters

ProjectName
[in] Specifies the full name of the project.

Right
[out] Returns the current user's access rights to the project.

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 GetProjectRight_Click()

	Dim Cancelled As Boolean
	Dim ResultDescription As String
	Dim Right As New SAWHRight
	Dim ProjectName As String

	ProjectName = "$/ProjectName"

	Dim ResultValue As Long
	ResultValue = sdkObject.GetProjectRight(ProjectName, Right, Cancelled, ResultDescription)

	If ResultValue <> 0 Then
		MsgBox "Failed to get the project rights."
		Exit Sub
	End If

	Dim AddRight As Boolean
	AddRight = Right.HasRightOf(Enum_AddRight)

End Sub