Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
# log in to Synapse
library(synapseClient)
synapseLogin(<your user name>, <your password>)

# use the synapse identifier for the data object to be put under access control
entityIds<-list("syn987654")

# # create the Tier Three access requirement
subjectIds<-lapply(entityIds, function(x){list(id=x,type="ENTITY")})
openJiraIssue<-TRUE # set to true or false to control whether the web portal allows the user to open a JIRA issue 
actContactInfo<-"Please complete the following form and email it to the Access and Compliance Team at act@sagebase.org.<br/>  1) Your name:<br/>  2) Your organization: <br/> 3) Your IRB number: <br/> "
ar <- list(concreteType="org.sagebionetworks.repo.model.ACTAccessRequirement", subjectIds=subjectIds, accessType="DOWNLOAD", actContactInfo=actContactInfo, openJiraIssue=openJiraIssue)

ar<-synRestPOST("/accessRequirement", ar)

 

How to add a wiki page to an access requirement:

In the above examples the text of the access requirement was embedded directly in the requirement (in the  'termsOfUse' or 'actContactInfo' field).  An alternative is to create a wiki page and attach it to the access requirement.  Synapse will then show the markdown from the wiki page when the access requirement is displayed.  To do this, first create the access requirement as shown above, but omit 'termsOfUse' or 'actContactInfo'. Then issue the following command

Code Block
wikipage <- list(title="title", markdown="put markdown here", attachmentFileHandleIds=c("101", "102", "103"))
synRestPOST(sprintf("/access_requirement/%s/wiki", ar$id), wikipage)

where you are to replace "title", "markdown" and the list of attachmentFileHandleIds with their actual values.  If you have already created a wiki that you wish ot use:

Code Block
wikipage <- synGetWiki(synGet("syn12345")) # Note: replace "syn12345" with the ID of the project, folder or file that has the wiki page.
wikipage$id<-NULL
wikipage$parentWikiId<-NULL
if (length(wikipage$attachmentFileHandleIds)==1) wikipage$attachmentFileHandleIds<-list(wikipage$attachmentFileHandleIds)
synRestPOST(sprintf("/access_requirement/%s/wiki", ar$id), wikipage)

 

When someone tries to download the data from the Web interface, they will be presented with instructions for contacting the Access and Compliance Team to request download access.

...