allowVisit(path, [user]) Last updated: 30. May 2026

API only function

Checks if the current user has website (view) access to the specified file or folder. Only applicable for sites with authentication enabled.

See also: Path traversal

Parameters

Name Type Description
path string

Absolute path to the file or folder.

user (optional) string

Username (email) of the user to check access for. Defaults to the current user.

Returns

True if current user has access, False if no access / item not found.

Example

Code example (JS)

JS is normal JavaScript either running in the browser or on the Docly™ server.
if (docly.allowVisit("test file"))
{
   return "Access allowed";
}