The option to "Only allow read-only" does not affect their ability to log in. Below is sample code showing log in/out functions.
' Global RA Session object set to nothing
' This object gets filled when logged in and
' reset to nothing when logged out.
Private _MySession As Session = Nothing
Public Property MySession As Session
Get
Return _MySession
End Get
Set(ByVal value As Session)
_MySession = value
End Set
End Property
Private Sub LFLogin(ByVal sLFServer As String, ByVal sRepo As String, _
ByVal bWindowAuth As Boolean, Optional ByVal sUser As String = _
"admin", Optional ByVal sPW As String = "")
' Only process if RA Session object is nothing
If MySession Is Nothing Then
Try
' log into the repository
Dim repository As New RepositoryRegistration(sLFServer, sRepo)
MySession = New Session()
' Process Authentication
If bWindowAuth Then
' Connect to the repository
MySession.LogIn(repository)
Else
'Do not use empty user name for LF Auth (if that is what was passed)
If String.IsNullOrEmpty(sUser) Then
' Try using admin with blank password
sUser = "admin"
sPW = ""
End If
' Connect to the repository
MySession.LogIn(sUser, sPW, repository)
End If
Catch ex As Exception
' Log Errors Here
MessageBox.Show(ex.Message)
' Ensure RA Session object is nothing
MySession = Nothing
End Try
End If
End Sub
Private Sub LFLogout()
' Only process if RA Session object is not nothing
If MySession IsNot Nothing Then
Try
' Log Out
MySession.LogOut()
' Set RA Session object to nothing
MySession = Nothing
Catch ex As Exception
' Log Errors Here
MessageBox.Show(ex.Message)
' Ensure RA Session object is nothing
MySession = Nothing
End Try
End If
End Sub