Skip to content

Commit

Permalink
Merge pull request #233 from afwillia/FDS-1274-manifest-permission
Browse files Browse the repository at this point in the history
Fds 1274 manifest permission
  • Loading branch information
lakikowolfe authored Jan 5, 2024
2 parents 1b939c1 + 70b4b1e commit f4041fe
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
23 changes: 23 additions & 0 deletions R/app_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,29 @@ app_server <- function( input, output, session ) {
selected_dcc_config_list$schema_url(mod_select_dcc_out()$selected_dcc_config$schema_url)
selected_dcc_config_list$icon(mod_select_dcc_out()$selected_dcc_config$icon)

# User must have DOWNLOAD access to the DFA manifest.
manifest_perm <- dfamodules::synapse_access(
id = selected_dcc_config_list$manifest_dataset_id(),
access = "DOWNLOAD",
auth = access_token
)
if (!isTRUE(manifest_perm)) {
shinypop::nx_report_error(
title = "Permission error",
message = tagList(
shiny::p("You don't have download permission to the DFA manifest",
shiny::a(href = paste0("https://www.synapse.org/#!Synapse:",
selected_dcc_config_list$manifest_dataset_id()),
selected_dcc_config_list$manifest_dataset_id(), taget = "_blank"
)
),
shiny::p("Refresh the app to try again or contact the DCC for help.")
)
)
shinyjs::hide(selector = "#NXReportButton")
waiter::waiter_hide()
}

dash_config <- dfamodules::generate_dashboard_config(
schema_url = selected_dcc_config_list$schema_url(),
icon = selected_dcc_config_list$icon(),
Expand Down
7 changes: 7 additions & 0 deletions R/app_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ app_ui <- function() {

# initialize shinyjs
shinyjs::useShinyjs(),

# Add nx report for error messages
shinypop::use_notiflix_report(
width = "500px",
messageMaxLength = 10000,
titleMaxLength = 100
),

# define colors for icons in datatable
# green check
Expand Down
11 changes: 11 additions & 0 deletions renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1618,6 +1618,17 @@
],
"Hash": "802e4786b353a4bb27116957558548d5"
},
"shinypop": {
"Package": "shinypop",
"Version": "0.1.1",
"Source": "GitHub",
"RemoteType": "github",
"RemoteHost": "api.github.com",
"RemoteUsername": "dreamRs",
"RemoteRepo": "shinypop",
"RemoteRef": "master",
"RemoteSha": "7745a0b1ecf31f783fa59603f3c5cede0c948118"
},
"sourcetools": {
"Package": "sourcetools",
"Version": "0.1.7-1",
Expand Down

0 comments on commit f4041fe

Please sign in to comment.