SnTT: @ServerAccess in LotusScript

January 31, 2008 – 5:21 pm

SnTT

You can use @ServerAccess to check if a specified user has a specified administrative access level to a server. For a list of keywords to represent the access level you want to check for take a look at the designer help either on your local client or on the web.

But what to do if you want to check the server access level using Lotus Script? The help document does not give you a cross reference to Lotusscript.

In this case, the Evaluate statement is your friend.
For further information about how to use Evaluate I recommend to read the following article on DeveloperWorks: “Simplifying your LotusScript with the Evaluate statement

The following function uses evaluate and @ServerAccess to make the @function available in LotusScript.

1
2
3
4
5
6
7
Function atServerAccess ( 
sAction As String, sUserName As String, sServerName As String ) As Boolean
  Dim vAccess As Variant
  vAccess = 
   Evaluate(|@ServerAccess(| + sAction + |; "| + sUserName_
                + |"; "| + sServerName + |")|)	atServerAccess = Cbool(vAccess(0))
End Function

Here is a sample of how to call the function

1
2
3
4
5
6
7
8
9
10
11
Sub Click(Source As Button)
  Dim sUser As String
  Dim sServer As String
  Dim sAction As String
  sUser = "Bill Gates/Microsoft"
  sServer = "MyServer/foo"
  sAction = "[RemoteAccess]"
 
  ' returns TRUE of FALSE
  Msgbox atServerAccess ( sAction, sUser, sServer )
End Sub

Related posts:

  1. Get Logical / physical size and DAOS size with LotusScript
  2. Get View Column Sums With LotusScript
  3. SnTT: Is database design hidden (Notes API Solution)
  4. Is User A Member Of A (Nested) Group ?
  5. PING in LotusScript

Sorry, comments for this entry are closed at this time.