LOTUSSCRIPT /COM/OLE のクラス


例:IsRoleEnabled メソッド
次のスクリプトは、ワークスペースに新しい文書を作成します。現在のユーザーがデータベースの [Supervisor] ロールのメンバーであるときは、[approval] フォームを使用して文書が作成されます。メンバーでないときには [request] フォームが使用されます。

Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Dim uidoc As NotesUIDocument
Dim acl As NotesACL    
Dim entry As NotesACLEntry
Set db = session.CurrentDatabase
Set acl = db.ACL
Set entry = acl.GetEntry( session.CommonUserName )
If entry Is Nothing Then
 Set entry = acl.GetEntry( session.UserName )
End If
If entry Is Nothing Then
 Messagebox _
 "No entry for " & session.CommonUserName & _
 " or " & session.UserName,, "No entry"
 Exit Sub
End If
If entry.IsRoleEnabled( "[Supervisor]" ) Then
 Set uidoc = workspace.ComposeDocument( "", "approval" )
Else
 Set uidoc = workspace.ComposeDocument( "", "request" )
End If

関連項目