Solid Edge Revision Manager Object Library
DoesUserHaveAdminRights Method
Specifies the file or folder location.
Specifies the user name.
Returns TRUE if the specified user has administrator rights for the specified file or folder.
Description
This method returns whether a specified user has administrator rights for a specified file or folder.
Syntax
Visual Basic
Public Function DoesUserHaveAdminRights( _
   ByVal FileOrFolderUrl As String, _
   ByVal UserName As String, _
   ByRef bUserHasAdminRights As Boolean _
) As Long
Parameters
FileOrFolderUrl
Specifies the file or folder location.
UserName
Specifies the user name.
bUserHasAdminRights
Returns TRUE if the specified user has administrator rights for the specified file or folder.
Example
Imports RevisionManager
Imports System.Runtime.InteropServices
Imports System.Security.Principal

Module Example

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

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

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

            FileOrFolderUrl = "http://solidvm/Engineering/PreReleased/PreReleasedDocLib/Summit.par"
            UserName = WindowsIdentity.GetCurrent().Name

            objInsight.DoesUserHaveAdminRights(FileOrFolderUrl, UserName, bUserHasAdminRights)

            If (bUserHasAdminRights) Then
                ' User has admin rights.
            End If
        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.