grantAccess (NotesDatabase - JavaScript™)
Modifies a database access control list to provide a specified level of access to a person, group, or server.
Defined in
NotesDatabaseSyntax
grantAccess(name:string, level:int) : void
Parameter | Description |
---|---|
name |
The name of the person, group, or server whose access level you want to provide or change. For a hierarchical name, the full name must be specified but can be in abbreviated format. |
level |
The level of access you're granting. Specify
one of the following constants:
|
Usage
If the name already exists in the ACL, this method updates it with the access. Otherwise, the name is added to the ACL with the level.You can also use this method to deny
access to a person, group, or server by assigning LEVEL_NOACCESS
.
This method sets ACL roles to their default values.
Examples
This button creates a database from the discussion template.var template:NotesDatabase = session.getDatabase(null, "discussion8.ntf", false);
if (template == null) {
requestScope.status = "discussion8.ntf does not exist locally";
return;
}
var newdb:NotesDatabase = template.createFromTemplate (null, "suggest", true);
newdb.setTitle("Suggestions for Giving Campaign");
newdb.grantAccess("-Default-", NotesACL.LEVEL_READER);
requestScope.status = "\"Suggestions for Giving Campagn\" created";