allowRead(path, [user]) Last updated: 11. Dec 2025
API only function
Checks if the current user has access to open the specified file or folder in Docly. Only applicable for sites with authentication enabled.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | Absolute path to file or folder. |
| user (optional) | string | Username (email) of the user to check access for. Defaults to the current user. |
Returns
True if curent 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";
}