allowDirectories: Allow server to access files in a directory

View source: R/jrc.R

allowDirectoriesR Documentation

Allow server to access files in a 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.

Details

This function is a wrapper around allowDirectories method of class App.

Value

Absolute paths to all currently allowed directories, if dirs = NULL.

See Also

openPage (check arguments rootDirectory and allowedDirectories).

Examples

## Not run: 
# to run this example an installed web browser is required
openPage()
# The directories must exist
allowDirectories(c("~/directory1", "../anotherDirectory"))
dirs <- allowDirectories()
closePage()
## End(Not run)


jrc documentation built on Aug. 23, 2023, 5:10 p.m.

Related to allowDirectories in jrc...