revokeAccess (NotesDatabase - JavaScript)

Removes a person, group, or server from a database access control list.

Defined in

NotesDatabase

Syntax

revokeAccess(name:string) : void
Parameter Description
name The name of the person, group, or server whose access you want to revoke. For a hierarchical name, the full name must be specified but can be in abbreviated format.

Usage

This method resets the access level for that person, group, or server to the Default setting for the database.

Revoking access is different than assigning No Access (which you can do with the grantAccess method). When you revoke access, you remove the name from the ACL, but the person, group, or server can still access the database at the level specified for Default. When you use the grantAccess method to assign No Access, the name remains in the ACL, and the person, group, or server cannot access the database, regardless of the Default setting.

The name must be explicitly listed in the database ACL. If it isn't, revokeAccess throws an exception, even if the name is a member of a group that is listed in the ACL.

Examples

This button revokes access for a specified ACL entry.
if (database.getACL().getEntry(requestScope.query) == null) {
	requestScope.status = "No ACL entry for " + requestScope.query;
} else {
	requestScope.status = "Removing ACL entry for " + requestScope.query;
	database.revokeAccess(requestScope.query)
}