Skip to content

Commit

Permalink
Merge pull request #600 from Sage-Bionetworks/FDS-2043-certified-user
Browse files Browse the repository at this point in the history
Fds 2043 certified user
  • Loading branch information
afwillia authored Jun 6, 2024
2 parents 486a221 + 3b4ea14 commit fc88320
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions server.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,25 +127,24 @@ shinyServer(function(input, output, session) {

if (dca_schematic_api != "offline") {
access_token <- session$userData$access_token
has_access <- vapply(all_asset_views, function(x) {
synapse_access(id = x, access = "DOWNLOAD", auth = access_token)
}, 1L)
asset_views(all_asset_views[has_access == 1])

if (length(asset_views) == 0) stop("You do not have DOWNLOAD access to any supported Asset Views.")
updateSelectInput(session, "dropdown_asset_view",
choices = asset_views()
)

user_name <- synapse_user_profile(auth = access_token)$firstName

is_certified <- synapse_is_certified(auth = access_token)
if (!is_certified) {
dcWaiter("update", landing = TRUE, isCertified = FALSE)
} else {
# update waiter loading screen once login successful
dcWaiter("update", landing = TRUE, userName = user_name)
}

has_access <- vapply(all_asset_views, function(x) {
synapse_access(id = x, access = "DOWNLOAD", auth = access_token)
}, 1L)
asset_views(all_asset_views[has_access == 1])

if (length(asset_views) == 0) stop("You do not have DOWNLOAD access to any supported Asset Views.")
updateSelectInput(session, "dropdown_asset_view",
choices = asset_views()
)
} else {
updateSelectInput(session, "dropdown_asset_view",
choices = c("Offline mock data (synXXXXXX)" = "synXXXXXX")
Expand Down

0 comments on commit fc88320

Please sign in to comment.