Skip to content

Commit

Permalink
expanded user rights
Browse files Browse the repository at this point in the history
close #523
  • Loading branch information
wibeasley committed Jun 11, 2024
1 parent 4fc71c6 commit 3042b3d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ This will help extract forms from longitudinal & repeating projects.

* `redcap_event_instruments()` now by default returns mappings for all arms. The previous default was to return the mappings for only the first arm. To recreate the previous behavior use a call like `REDCapR::redcap_event_instruments(uri, token_2, arms = "1")`. (Suggested by @januz, #482)

* `redcap_users_export()` used to return a boolean for `user_rights`, but now it can be 0, 1, or 2. (#523)

### New Features

* New `redcap_metadata_coltypes()` function. Inspects the fields types and validation text of each field to generate a suggested `readr::col_types` object that reflects the project's current data dictionary. The object then can be passed to the `col_types` parameter of `redcap_read()` or `redcap_read_oneshot()`. (Suggested and discussed with @pbchase, @nutterb, @skadauke, & others, #405 & #294)
Expand Down
2 changes: 1 addition & 1 deletion R/redcap-users-export.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ redcap_users_export <- function(
data_access_group = readr::col_character(),
data_access_group_id = readr::col_character(),
design = readr::col_logical(),
user_rights = readr::col_logical(),
user_rights = readr::col_integer(),
data_access_groups = readr::col_logical(),
# data_export = readr::col_character(), # dropped sometime between 10.5.1 and 12.5.2
reports = readr::col_logical(),
Expand Down
21 changes: 11 additions & 10 deletions inst/test-data/specific-redcapr/users-export/with-dags--user.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ structure(list(username = c("unittestphifree", "wbeasleya"),
), firstname = c("Unit Test", "Will"), lastname = c("PHI Free",
"Beasley_A"), expiration = structure(c(NA_real_, NA_real_
), class = "Date"), data_access_group = c("daga", NA), data_access_group_id = c("331",
NA), design = c(FALSE, TRUE), alerts = c(0, 1), user_rights = c(FALSE,
TRUE), data_access_groups = c(FALSE, TRUE), reports = c(FALSE,
TRUE), stats_and_charts = c(FALSE, TRUE), manage_survey_participants = c(TRUE,
NA), design = c(FALSE, TRUE), alerts = c(0, 1), user_rights = 2:1,
data_access_groups = c(FALSE, TRUE), reports = c(FALSE, TRUE
), stats_and_charts = c(FALSE, TRUE), manage_survey_participants = c(TRUE,
TRUE), calendar = c(FALSE, TRUE), data_import_tool = c(FALSE,
TRUE), data_comparison_tool = c(FALSE, TRUE), logging = c(FALSE,
TRUE), file_repository = c(FALSE, TRUE), data_quality_create = c(FALSE,
TRUE), data_quality_execute = c(FALSE, TRUE), api_export = c(TRUE,
TRUE), api_import = c(FALSE, TRUE), mobile_app = c(FALSE,
TRUE), mobile_app_download_data = c(FALSE, TRUE), record_create = c(FALSE,
TRUE), record_rename = c(FALSE, FALSE), record_delete = c(FALSE,
FALSE), lock_records_all_forms = c(FALSE, FALSE), lock_records = c(FALSE,
FALSE), lock_records_customization = c(FALSE, FALSE), forms_export = c("demographics:1",
"demographics:1")), row.names = c(NA, -2L), class = c("tbl_df",
"tbl", "data.frame"))
TRUE), api_import = c(FALSE, TRUE), api_modules = c(0, 0),
mobile_app = c(FALSE, TRUE), mobile_app_download_data = c(FALSE,
TRUE), record_create = c(FALSE, TRUE), record_rename = c(FALSE,
FALSE), record_delete = c(FALSE, FALSE), lock_records_all_forms = c(FALSE,
FALSE), lock_records = c(FALSE, FALSE), lock_records_customization = c(FALSE,
FALSE), forms_export = c("demographics:1", "demographics:1"
)), row.names = c(NA, -2L), class = c("tbl_df", "tbl", "data.frame"
))
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ structure(list(username = c("unittestphifree", "wbeasleya"),
"Beasley_A"), expiration = structure(c(NA_real_, NA_real_
), class = "Date"), data_access_group = c(NA_character_,
NA_character_), data_access_group_id = c(NA_character_, NA_character_
), design = c(FALSE, TRUE), alerts = c(0, 1), user_rights = c(FALSE,
TRUE), data_access_groups = c(FALSE, TRUE), reports = c(TRUE,
TRUE), stats_and_charts = c(TRUE, TRUE), manage_survey_participants = c(TRUE,
), design = c(FALSE, TRUE), alerts = c(0, 1), user_rights = 2:1,
data_access_groups = c(FALSE, TRUE), reports = c(TRUE, TRUE
), stats_and_charts = c(TRUE, TRUE), manage_survey_participants = c(TRUE,
TRUE), calendar = c(TRUE, TRUE), data_import_tool = c(FALSE,
TRUE), data_comparison_tool = c(FALSE, TRUE), logging = c(TRUE,
TRUE), file_repository = c(TRUE, TRUE), data_quality_create = c(FALSE,
TRUE), data_quality_execute = c(FALSE, TRUE), api_export = c(TRUE,
FALSE), api_import = c(FALSE, FALSE), mobile_app = c(FALSE,
FALSE), mobile_app_download_data = c(FALSE, FALSE), record_create = c(TRUE,
TRUE), record_rename = c(FALSE, FALSE), record_delete = c(FALSE,
FALSE), lock_records_all_forms = c(FALSE, FALSE), lock_records = c(FALSE,
FALSE), lock_records_customization = c(FALSE, FALSE), forms_export = c("demographics:1,health:1,race_and_ethnicity:1",
FALSE), api_import = c(FALSE, FALSE), api_modules = c(0,
0), mobile_app = c(FALSE, FALSE), mobile_app_download_data = c(FALSE,
FALSE), record_create = c(TRUE, TRUE), record_rename = c(FALSE,
FALSE), record_delete = c(FALSE, FALSE), lock_records_all_forms = c(FALSE,
FALSE), lock_records = c(FALSE, FALSE), lock_records_customization = c(FALSE,
FALSE), forms_export = c("demographics:1,health:1,race_and_ethnicity:1",
"demographics:1,health:1,race_and_ethnicity:1")), row.names = c(NA,
-2L), class = c("tbl_df", "tbl", "data.frame"))

0 comments on commit 3042b3d

Please sign in to comment.