-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into remove_as_data_frame_param
- Loading branch information
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
have_access <- function() { | ||
file.access(get_lookups_dir(), 4) >= 0L | ||
} | ||
check_lookups_access <- function(fail_on_no_access = TRUE) { | ||
if (!have_access()) { | ||
no_access_msg <- c( | ||
"x" = "You don't have the appropriate file permissions to {get_lookups_dir()}", | ||
"i" = "Please raise a ServiceNow request for access to the UNIX acute dataset" | ||
) | ||
if (fail_on_no_access) { | ||
cli::cli_abort(no_access_msg) | ||
} else { | ||
cli::cli_warn(no_access_msg) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.onLoad <- function(libname, pkgname) { | ||
check_lookups_access(fail_on_no_access = FALSE) | ||
} |