Skip to content

Commit

Permalink
🐛 All non-open acl values should be prefixed w /programs
Browse files Browse the repository at this point in the history
  • Loading branch information
znatty22 committed Oct 12, 2023
1 parent 7fc3ef8 commit 54faed7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ The `--match_aliquot` flag will match dbGaP `submitted_sample_id` to `external_a
`dbgapconsent SD_12345678 --server https://kf-api-dataservice.kidsfirstdrc.org --db_url postgresql://{USER_NAME}:{PASSWORD}@{PG_HOST}:{PG_PORT}/{PG_DBNAME} --dry_run --match_aliquot`

---

## ACL Definitions

* study_phs: (e.g. "phs001138")
* consent_acl: f"/programs/{study_phs}.c{consent_code}" (consent_code for the specimen)
* default_acl: set([{consent_acl} from visible biospecimens which contribute to the genomic file])
* study_kf_id: e.g SD_12345678
* default_acl: e.g. "/programs/{study_kf_id}"
* study_phs: e.g. "phs001138"
* consent_acl: f"/programs/{study_phs}.c{consent_code}" (consent_code for the specimen)
* specimen_acl: unique([{consent_acl} from visible biospecimens which contribute to the genomic file])
* open_acl: ["/open"]

## ACL Rules
Expand Down Expand Up @@ -64,9 +65,11 @@ The `--match_aliquot` flag will match dbGaP `submitted_sample_id` to `external_a
field set to **False** should get `{open_acl}`.

* All visible genomic files in the dataservice with their `controlled_access`
field set to **True** should get the `{default_acl}`.
field set to **True** should get the `{default_acl}`. If the genomic file
previously had an ACL containing the study KF ID, this will be replaced with
the `{specimen_acl}` containing the PHS ID.

* The `default_acl` is the unique set of the `consent_acl` from the visible
* The `specimen_acl` is the unique set of the `consent_acl` from the visible
specimens in the study which contribute to the genomic_file.

* The `consent_acl` is composed of the study phs ID and the
Expand All @@ -77,3 +80,4 @@ prefix "/programs" (e.g. "/programs/phs001138.c1")
indicating no access.



16 changes: 9 additions & 7 deletions kf_update_dbgap_consent/sample_status.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
"""
## ACL Definitions
* study_phs: (e.g. "phs001138")
* study_kf_id: e.g SD_12345678
* default_acl: e.g. "/programs/{study_kf_id}"
* study_phs: e.g. "phs001138"
* consent_acl: f"/programs/{study_phs}.c{consent_code}" (consent_code for the specimen)
* default_acl: unique([{consent_acl} from visible biospecimens which contribute to the genomic file])
* specimen_acl: unique([{consent_acl} from visible biospecimens which contribute to the genomic file])
* open_acl: ["/open"]
## ACL Rules
Expand Down Expand Up @@ -39,9 +41,9 @@
* All visible genomic files in the dataservice with their `controlled_access`
field set to **True** should get the `{default_acl}`. If the genomic file
previously had an ACL containing the study KF ID, this will be replaced with
the `{default_acl}` containing the PHS ID.
the `{specimen_acl}` containing the PHS ID.
* The `default_acl` is the unique set of the `consent_acl` from the visible
* The `specimen_acl` is the unique set of the `consent_acl` from the visible
specimens in the study which contribute to the genomic_file.
* The `consent_acl` is composed of the study phs ID and the
Expand Down Expand Up @@ -136,7 +138,7 @@ def get_patches_for_study(
print(f"Found accession ID: {study_phs}")
open_acl = {"/open"}
empty_acl = set()
default_acl = [study_id]
default_acl = [f"/programs/{study_id}"]
alerts = []
patches = defaultdict(lambda: defaultdict(dict))

Expand Down Expand Up @@ -320,9 +322,9 @@ def entities_dict(endpoint, filt):
"""
Rule: All visible genomic files in the dataservice with
their `controlled_access` field set to **True** should get
the `{default_acl}`.
the `{specimen_acl}`.
* The `default_acl` is the unique set of the `consent_acl`
* The `specimen_acl` is the unique set of the `consent_acl`
from the visible specimens in the study which contribute to
the genomic_file.
Expand Down

0 comments on commit 54faed7

Please sign in to comment.