Function API only Updated 17 Oct 2026
allowVisit(path, [username])
Checks whether the logged-in visitor, or a given user, has website (Visit) access to the specified file or folder. Only meaningful on sites with login.
See also Path traversal
Parameters
pathstringrequiredPath to the file or folder, from the site root. The path is looked up as a folder first, then as a file.
usernamestringoptionalLogin (email) of the user to check. Defaults to the logged-in visitor.
Returns
true or false. false when no username is given and nobody is logged in, when the user is unknown, or when the path matches neither a folder nor a file.
Example
Normal JavaScript, running in the browser or on the Docly™ server.
if (docly.allowVisit("test file"))
{
return "Access allowed";
}