'
'  NotesAuthorization.lss
'
'  Time-stamp: <2002-01-04 16:11:30 deriksso>
'
'  Date        Author           Changes
'  ----------  ---------------  ------------------------------------
'  2000-08-25  Daniel Eriksson  Created
'

Public Class NotesAuthorization
'Class for working with levels of Notes access
'Example:
'(The constant ACLLEVEL_EDITOR comes from lsconst.lss, so you might have 
'to write %INCLUDE "lsconst.lss" in your Options section.)
'
' Dim auth As New NotesAuthorization(ACLLEVEL_EDITOR)
' Dim ses As New NotesSession
' 
' If (auth.isAuthorised(ses.CurrentDatabase.CurrentAccessLevel)) Then
'   Call run()
' Else    
'   Messagebox "You must be at least editor to run this " &_
'   "command.",, "Failure"
' End If

Private level_ As Integer

Public Sub New(level As Integer)
  level_ = level
End Sub

Public Function isAuthorised(level As Integer) As Variant
  If (level >= level_) Then
    isAuthorised = True
  Else 
    isAuthorised = False
  End If
End Function
End Class