Solid Edge Revision Manager Object Library
GetUserRole Method
Specifies the URL path of the file or folder for which the UserName rights will be queried.
Specifies the user name.
Specifies the user role for the specified file or folder and user name.
Description
This method returns the user role for a specified file or folder and user name.
Syntax
Visual Basic
Public Function GetUserRole( _
   ByVal FileOrFolderUrl As String, _
   ByVal UserName As String, _
   ByRef UserRole As String _
) As Long
Parameters
FileOrFolderUrl
Specifies the URL path of the file or folder for which the UserName rights will be queried.
UserName
Specifies the user name.
UserRole
Specifies the user role for the specified file or folder and user name.
Example
Imports RevisionManager
Imports System.Runtime.InteropServices

Module Example

    Sub Main()
        Dim objApplication As RevisionManager.Application = Nothing
        Dim objInsight As RevisionManager.Insight = Nothing
        Dim FileOrFolderUrl As String
        Dim UserName As String
        Dim UserRole As String = String.Empty

        Try
            ' Start Revision Manager.
            objApplication = New RevisionManager.Application

            ' Get reference to Insight object.
            objInsight = objApplication.Insight

            FileOrFolderUrl = "http://solidvm/Engineering/PreReleased/PreReleasedDocLib/Summit.par"   'does not seem to work if only give folder
            UserName = "PLM\mdthomps"

            objInsight.GetUserRole(FileOrFolderUrl, UserName, UserRole)
        Catch ex As Exception
            ' Write any errors to console.
            Console.WriteLine(ex.Message)
        Finally
            ' Release COM Objects.
            If Not (objInsight Is Nothing) Then
                Marshal.ReleaseComObject(objInsight)
                objInsight = Nothing
            End If

            If Not (objApplication Is Nothing) Then
                objApplication.Quit()
                Marshal.ReleaseComObject(objApplication)
                objApplication = Nothing
            End If
        End Try
    End Sub

End Module
See Also

Insight Object  | Insight Members

Send comments on this topic.