Skip to content

Commit

Permalink
Add to news and fix markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasyu888 committed Feb 4, 2024
1 parent 5e5c880 commit 3bf86eb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Python synapsePythonClient dependency updated to 4.0.0
* You can only login via a Synapse Personal Access token now. All other forms of authentication have been disabled for security purposes.
* `synSetAnnotations` removed as it is not working as expected due to implementation in the Python API.
* For more changes, please view the 3.2.0 and 4.0.0 changes on the [Python client documentation](https://python-docs.synapse.org/news/).

## synapser 1.3.0

Expand Down
23 changes: 12 additions & 11 deletions vignettes/synapser.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -236,23 +236,17 @@ For more details see the native reference documentation, e.g.:
# (We use a time stamp just to help ensure uniqueness.)
projectName <- sprintf("My unique project created on %s", format(Sys.time(), "%a %b %d %H%M%OS4 %Y"))
project <- Project(projectName)
# This will erase all existing annotations
project$annotations <- list(annotationName = "annotationValue")
project <- synStore(project)
```

```{r collapse = TRUE}
synSetAnnotations(project, list(annotationName = "annotationValue"))
project <- synGet(project$properties$id)
project$annotations
synGetAnnotations(project)
```

`synSetAnnotations` will replace all the existing annotations with the given annotations. Hence, to add a new annotation to the ones currently defined for an entity, we must retrieve it:
```{r collapse = TRUE}
annotations <- synGetAnnotations(project)
annotations[["numeric_annotation_name"]] <- 42
annotations <- synSetAnnotations(project, annotations)
annotations
```

## Provenance

Expand Down Expand Up @@ -468,7 +462,7 @@ easily be shared with specific users, groups, or the public.

Retrieve the sharing setting on an entity:
```{r collapse = TRUE}
synGetPermissions(project, principalId = 273950)
synGetAcl(project, principal_id = "273950")
```
The first time an entity is shared, an ACL object is created for that entity. Let's make project public:
```{r collapse = TRUE}
Expand All @@ -477,12 +471,19 @@ acl
```
Now public can read:
```{r collapse = TRUE}
synGetPermissions(project, principalId = 273950)
synGetAcl(project, principal_id = 273950)
```

Get permissions will obtain more human-readable view of an entity's permissions
```{r collapse = TRUE}
permissions = synGetPermissions(project)
permissions$can_view
```

```{r eval = FALSE}
?synGetPermissions
?synGetAcl
?synSetPermissions
?synGetPermissions
```

```{r collapse = TRUE}
Expand Down

0 comments on commit 3bf86eb

Please sign in to comment.