Examples: GrantAccess method

  1. This script gives Author access to the PROFITS.NSF database for everyone in the group Sales Supervisors.
    Dim db As New NotesDatabase( "Sydney", "profits.nsf")
    Call db.GrantAccess("Sales Supervisors", ACLLEVEL_AUTHOR)
  2. This script provides Designer access to the current database for all servers in the local domain, and Reader access for all servers from other domains.
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Set db = session.CurrentDatabase
    Call db.GrantAccess( "LocalDomainServers", _
    ACLLEVEL_DESIGNER )
    Call db.GrantAccess( "OtherDomainServers", _
    ACLLEVEL_READER )
  3. This script prevents Will Kates from accessing the database. If the default for the database is No Access, it revokes Will's access by making him a member of the default group; otherwise (if the default is Reader, for example), it specifically provides No Access to Will.
    Dim db As New NotesDatabase( "Sydney","profits.nsf")
    If (db.QueryAccess("-Default-")=ACLLEVEL_NOACCESS) _  
    Then
      Call db.RevokeAccess("Will Kates")
    Else
      Call db.GrantAccess("Will Kates",ACLLEVEL_NOACCESS )
    End If