allowDirectories: Allow server to access files in the directory
Description
This function adds paths to existing directories to the list of allowed directories,
which can be accessed from the server. To any request for files from outside
of the allowed directories the server will response with 403 Forbidden error.
rootDirectory (see openPage) can always be accessed. By default,
when the app is initialized, current working directory
is added to the list of allowed directories. Further changes
of the working directory will not have any affect on this list or files accessibility.
Usage
allowDirectories(dirs = NULL)
Arguments
dirs
Vector of paths to existing directories. Can be absolute paths, or paths relative to
the current working directory. If the specified directory doesn't exist, it will be ignored and a
warning will be produced. If NULL, returns absolute paths to all currently allowed directories.
Value
Absolute paths to all currently allowed directories, if dirs = NULL.
Details
This function is a wrapper around allowDirectories method of class App.
See Also
openPage (check arguments rootDirectory and allowedDirectories).
# NOT RUN {openPage()
# The directories must existallowDirectories(c("~/directory1", "../anotherDirectory"))
dirs <- allowDirectories()
closePage()
# }# NOT RUN {# }