quarta-feira, 4 de agosto de 2010

Verifica se o usuário possui a Role passada como parametro

Function UsuarioPossuiRole(Role As String, Usuario As String) As Variant

Dim session As New NotesSession
Dim db As NotesDatabase
Dim acl As NotesACL
Dim entry As NotesACLEntry
Set db = session.CurrentDatabase
Set acl = db.ACL
Set entry = acl.GetEntry( Usuario )
If Not entry Is Nothing Then
Forall r In entry.Roles
If r = Role Then
UsuarioPossuiRole = True
Exit Function
Else
UsuarioPossuiRole = False
End If
End Forall
Else
UsuarioPossuiRole = False
End If

End Function

Nenhum comentário:

Postar um comentário