'/以下例子是把当前用户设置为"[管理员]"角色:
dim session as new NotesSession
dim db as NotesDatabase
dim acl as NotesACL
dim aclentry as NotesACLEntry
set db=session.CurrentDatabase '/当前数据库
set acl=db.ACL '/当前数据库的ACL
set aclentry=acl.GetEntry(session.UserName) '/取当前用户在当前数据库的ACL权限
if aclentry is nothing then
msgbox "当前用户不包括在ACL列表中。"
else
call aclentry.EnableRole("[管理员]")
'/如果取消角色则:call aclentry.DisableRole("[管理员]")
end if