2017-11-17 15 views
0

ユーザは、データベースを選択し、ACL(読み込みを含む)を読み込んで文書に保存するアプリケーションを作成するように求められました。 ACLをスキャンしてそのようなコンテンツをキャプチャする方法は見つけられませんでした。ACLの読み込みとキャプチャ

+0

catalog.nsfにはすでにすべての情報が入っています。 – stwissel

+0

私はそのデータベースを完全に忘れてしまった。ありがとうございました – RoyRumaner

答えて

3

データベースのACLには、JavaのDatabaseクラスを使用してアクセスできます。そのための方法はgetAcl()です。 ACLを取得したら、すべてのエントリをループすることができます。

すべてAclEntryオブジェクトはここなどのアクセスレベルを取得する方法、役割、

2

はあなたにこの情報を郵送するためのコードですしています サーバー:XYZ ファイル名:e_drev \ レプリカ-ID abc.nsf:41256E1B0019C95Cなし ACLエントリのアクセスレベルの役割(複数可) の-Default-マネージャのアクセスを作成することができます削除できのUserType [設定]未指定はいはい

薄暗いセッションなどの新しいNotesSession型: 管理サーバーに設定されていない一貫性のあるACLを強制します210薄暗いナムとしてNotesName
薄暗いデシベルのNotesDatabase 薄暗いmaildocとしてのNotesDocument
暗いACLとしてNotesACLEntry としてのNotesACL 暗いエントリとして暗いENTRYNAME文字として文字列 暗いレベルとして文字列 薄暗いRTIとして文字列 暗いuTypeとして 薄暗いロールNotesRichTextTable

Set nam = session.CreateName(session.UserName) 

Dim workspace As New NotesUIWorkspace 
Dim askme As Variant 

askme = workspace.Prompt("13","Mail me ACL and DB-info", "Select database to report on: ") 
Set db = session.GetDatabase(askme(0), askme(1)) 
Set acl = db.ACL 

Dim richStyle As NotesRichTextStyle 
Set richStyle = session.CreateRichTextStyle 
richStyle.NotesFont = FONT_HELV 
richStyle.FontSize = 9 
richStyle.Bold = True 

Dim plainStyle As NotesRichTextStyle  
Set plainStyle = session.CreateRichTextStyle 
plainStyle.Bold = False 

Set maildoc = New NotesDocument(db) 

Set rti = maildoc.CreateRichTextItem("body") 
Call rti.AppendText("Server: " + db.Server + Chr(13)) 
Call rti.AppendText("Filename: " + db.FilePath + Chr(13)) 
Call rti.AppendText("Replica-ID: " + db.ReplicaID + Chr(13)) 

If acl.UniformAccess Then 
    Call rti.AppendText("Enforce consistent ACL is set" + Chr(13)) 
Else 
    Call rti.AppendText("Enforce consistent ACL is NOT set" + Chr(13)) 
End If 

If acl.AdministrationServer <> "" Then 
    Call rti.AppendText("Administration server: " + acl.AdministrationServer + Chr(13)) 
Else 
    Call rti.AppendText("Administration server: None" + Chr(13)) 
End If 

Call rti.AppendTable(1, 6) 

Set rtnav = rti.CreateNavigator  
Call rtnav.FindFirstElement(RTELEM_TYPE_TABLE) 
Set rtt = rtnav.GetElement 

Call rtnav.FindFirstElement(RTELEM_TYPE_TABLECELL) 

としてNotesRichTextNavigator 薄暗いRTTとしてNotesRichTextItem 薄暗いrtnav」として表の見出しを作成 電話番号rti.AppendStyle(richStyle)

Call rti.BeginInsert(rtnav) 
rti.AppendText("ACL Entry") 
Call rti.EndInsert 
Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) 

Call rti.BeginInsert(rtnav) 
rti.AppendText("Access Level") 
Call rti.EndInsert 
Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) 

Call rti.BeginInsert(rtnav) 
rti.AppendText("Roles(s)") 
Call rti.EndInsert 
Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) 

Call rti.BeginInsert(rtnav) 
rti.AppendText("UserType") 
Call rti.EndInsert 
Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) 

Call rti.BeginInsert(rtnav) 
rti.AppendText("Can delete") 
Call rti.EndInsert 
Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) 

Call rti.BeginInsert(rtnav) 
rti.AppendText("Can create") 
Call rti.EndInsert 
Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) 

Set entry = acl.GetFirstEntry 

While Not (entry Is Nothing) 
    entryName = entry.Name 

    If (entry.Level = ACLLEVEL_NOACCESS) Then 
     level = "No access" 
    Elseif (entry.Level = ACLLEVEL_DEPOSITOR) Then 
     level = "Depositor" 
    Elseif (entry.Level = ACLLEVEL_READER) Then 
     level = "Reader" 
    Elseif (entry.Level = ACLLEVEL_AUTHOR) Then 
     level = "Author" 
    Elseif (entry.Level = ACLLEVEL_EDITOR) Then 
     level = "Editor" 
    Elseif (entry.Level = ACLLEVEL_DESIGNER) Then 
     level = "Designer" 
    Elseif (entry.Level = ACLLEVEL_MANAGER) Then 
     level = "Manager access" 
    End If   

    Forall role In entry.Roles 

     If Isarray(entry.Roles) Then 
      roles = roles & role & " " 
     End If 

    End Forall 

    If (entry.UserType = ACLTYPE_UNSPECIFIED) Then 
     uType = "Unspecified" 
    Elseif (entry.UserType = ACLTYPE_PERSON) Then 
     uType = "Person" 
    Elseif (entry.UserType = ACLTYPE_SERVER) Then 
     uType = "Server" 
    Elseif (entry.UserType = ACLTYPE_MIXED_GROUP) Then 
     uType = "Mixed group" 
    Elseif (entry.UserType = ACLTYPE_PERSON_GROUP) Then 
     uType = "Person group" 
    Elseif (entry.UserType = ACLTYPE_SERVER_GROUP) Then 
     uType = "Server group" 
    End If 

    Call rtt.AddRow(1) 
    Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) 

    Call rti.AppendStyle(plainStyle) ' turn off bold 
    Call rti.BeginInsert(rtnav) 
    rti.AppendText(entryName) 
    Call rti.EndInsert 
    Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) 

    Call rti.BeginInsert(rtnav) 
    rti.AppendText(level) 
    Call rti.EndInsert 
    Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) 

    Call rti.BeginInsert(rtnav) 
    rti.AppendText(roles) 
    Call rti.EndInsert 
    Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) 

    'UserType 
    Call rti.BeginInsert(rtnav) 
    rti.AppendText(uType) 
    Call rti.EndInsert 
    Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) 

    'CanDelete 
    Call rti.BeginInsert(rtnav) 
    If entry.CanDeleteDocuments Then 
     rti.AppendText("Yes") 
    Else 
     rti.AppendText("No")  
    End If 
    Call rti.EndInsert 
    Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) 

    'CanCreate 
    Call rti.BeginInsert(rtnav) 
    If entry.CanCreateDocuments Then 
     rti.AppendText("Yes") 
    Else 
     rti.AppendText("No")  
    End If 
    Call rti.EndInsert 
    Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) 

    Set entry = acl.GetnextEntry(entry) 
    roles = "" 

Wend  

maildoc.form="Memo" 
maildoc.subject="ACL and database info for " & db.Title 
Call maildoc.Send(False, session.UserName) ' use current name for to address 

Messagebox "An email has been sent to " & nam.Abbreviated , 0 , "Action Complete" 
+0

ありがとうございます。電子メールとテーブルに興味はありませんが、XPageのフィールドに入っていなければなりません – RoyRumaner

関連する問題