Das Notes Forum
Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: deepsee3 am 03.08.03 - 22:19:18
-
Hi
Bin hier am tüffteln ... ich habe ne Rolle [mail] in meiner DB eingebaut.
Sobald ich ne Funktion ausführe will ich eine Mail automatisch an die User der Rolle mail versenden. Leider komm ich nicht dahinter wie ich die Usernames auslesen kann ?
Hat jemand ne Idee ... geht das überhaupt ?
Hab es schon mit Filteransichten probiert ... war aber leider kein erfolg.
Die meisten Funktionen geben nur 0 oder 1 zurück.
Vielleicht hat ja jemand von euch ne Idee
thx
-
Hi,
dazu gibt es in Script die Klassen "NotesACL" und "NotesACLEntry".
Du musst über alle Einträge der ACL iteriere und dann mit
flag = notesACLEntry.IsRoleEnabled( "[mail]" )
abfragen, ob der Eintrag die Rolle hat.
Falls ja, den Eintrag zum Mailempfänger hinzufügen.
Andreas
-
Hi,
wohl über die Roles-Property.
Die Designerhilfe hat ein Beispiel:
This script lets the user enter a role name into a dialog box. The script then displays the name of each entry for which the role is enabled in a field on the current document called People. The script adds brackets to the role name that the user enters, and then uses the Roles property to make sure that the name exists in the current database. If not, an error message is displayed; if so, the script continues.
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim session As New NotesSession
Dim db As NotesDatabase
Dim acl As NotesACL
Dim entry As NotesACLEntry
Dim roleName As String
Dim foundRole As Variant
Set uidoc = workspace.CurrentDocument
Set db = session.CurrentDatabase
Set acl = db.ACL
roleName = Inputbox$( "Enter the name of the role" )
' add brackets to role
roleName = "[" & roleName & "]"
foundRole = False
' check to see if the role exists in the database
Forall r In acl.Roles
If ( r = roleName ) Then
foundRole = True
Exit Forall
End If
End Forall
If ( foundRole = False ) Then
Messagebox _
( "Sorry, " & roleName & " is not a role" )
' if the role exists, check each acl entry to see if role
' is enabled for entry
' if so, add entry name to the People field
' on the current document,
' followed by a semicolon, the multi-value separator
Else
Set entry = acl.GetFirstEntry
While Not ( entry Is Nothing )
If ( entry.IsRoleEnabled( roleName ) = True ) Then
Call uidoc.FieldAppendText _
( "People", entry.Name & ";" )
End If
Set entry = acl.GetNextEntry( entry )
Wend
End If
' refresh current document so People field displays nicely
Call uidoc.Refresh
hth,
Case
-
ups, Glombi war schneller....
Case
-
ju
Danke ... probier ich gleich mal aus ... bin zwar nicht so fitt im Script ,aber das bekomm ich schon hin . Hauptsache ne Lösung ;D
Danke