Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renamed use restriction enums. #245

Merged
merged 3 commits into from
Jun 29, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions core/fixtures/elu-dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,10 @@
"use_restriction_rule": {
"type": "string",
"enum": [
"CONSTRAINTS",
"NO_CONSTRAINTS",
"FORBIDDEN"
"OBLIGATION",
"PERMISSION",
"PROHIBITION",
"CONSTRAINED_PERMISSION"
]
},
"use_restriction_objects": {
Expand Down
2 changes: 1 addition & 1 deletion core/importer/datasets_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class DatasetsImporter(BaseImporter):
"""

json_schema_validator = DatasetJSONSchemaValidator()
json_schema_uri = 'https://raw.githubusercontent.com/elixir-luxembourg/json-schemas/master/schemas/elu-dataset.json'
#json_schema_uri = 'https://raw.githubusercontent.com/elixir-luxembourg/json-schemas/master/schemas/elu-dataset.json'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jLebioda what do you think? Can I include the repository with JSON schemas as a submodule? It makes more sense than having one url which might not work and another fallback copy of schemas in fixtures.


def process_json(self, dataset_dict):
try:
Expand Down
18 changes: 18 additions & 0 deletions core/migrations/0019_auto_20210622_1822.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.20 on 2021-06-22 16:22

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0018_load_datalogtype_fixtures'),
]

operations = [
migrations.AlterField(
model_name='userestriction',
name='use_restriction_rule',
field=models.TextField(choices=[('OBLIGATION', 'OBLIGATION'), ('PERMISSION', 'PERMISSION'), ('PROHIBITION', 'PROHIBITION')], default='PROHIBITION', max_length=64, verbose_name='Use Restriction Rule'),
),
]
18 changes: 18 additions & 0 deletions core/migrations/0020_auto_20210622_1829.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.20 on 2021-06-22 16:29

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0019_auto_20210622_1822'),
]

operations = [
migrations.AlterField(
model_name='userestriction',
name='use_restriction_rule',
field=models.TextField(choices=[('OBLIGATION', 'OBLIGATION'), ('PERMISSION', 'PERMISSION'), ('PROHIBITION', 'PROHIBITION'), ('CONSTRAINED_PERMISSION', 'CONSTRAINED_PERMISSION')], default='PROHIBITION', max_length=64, verbose_name='Use Restriction Rule'),
),
]
9 changes: 5 additions & 4 deletions core/models/use_restriction.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@


USE_RESTRICTION_CHOICES = Choices(
('CONSTRAINTS', 'CONSTRAINTS'),
('NO_CONSTRAINTS', 'NO_CONSTRAINTS'),
('FORBIDDEN', 'FORBIDDEN')
('OBLIGATION', 'OBLIGATION'),
('PERMISSION', 'PERMISSION'),
('PROHIBITION', 'PROHIBITION'),
('CONSTRAINED_PERMISSION', 'CONSTRAINED_PERMISSION'),
)


Expand Down Expand Up @@ -45,7 +46,7 @@ class Meta:

use_restriction_rule = models.TextField(verbose_name='Use Restriction Rule',
choices=USE_RESTRICTION_CHOICES,
default=USE_RESTRICTION_CHOICES.NO_CONSTRAINTS,
default=USE_RESTRICTION_CHOICES.PROHIBITION,
blank=False,
null=False,
max_length=64)
Expand Down
22 changes: 11 additions & 11 deletions core/tests/data/datasets.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@
{
"use_class": "PS",
"use_class_note": "Use is restricted to projects: ABCD",
"use_restriction_rule": "CONSTRAINTS"
"use_restriction_rule": "OBLIGATION"
},
{
"use_class": "PUB",
"use_class_note": "Acknowledgement required.",
"use_restriction_rule": "CONSTRAINTS"
"use_restriction_rule": "OBLIGATION"
}
]
}
Expand Down Expand Up @@ -108,12 +108,12 @@
{
"use_class": "PS",
"use_class_note": "Use is restricted to projects: Hypertension",
"use_restriction_rule": "CONSTRAINTS"
"use_restriction_rule": "CONSTRAINED_PERMISSION"
},
{
"use_class": "RS-[XX]",
"use_class_note": "Use is restricted to research areas: Hypertension-ABC disease",
"use_restriction_rule": "CONSTRAINTS"
"use_restriction_rule": "CONSTRAINED_PERMISSION"
}
]
}
Expand Down Expand Up @@ -215,7 +215,7 @@
{
"use_class": "PUB",
"use_class_note": "Acknowledgement required.",
"use_restriction_rule": "CONSTRAINTS"
"use_restriction_rule": "OBLIGATION"
}
]
}
Expand Down Expand Up @@ -335,17 +335,17 @@
{
"use_class": "PS",
"use_class_note": "Consent form restricts data use to projects XYZ",
"use_restriction_rule": "CONSTRAINTS"
"use_restriction_rule": "CONSTRAINED_PERMISSION"
},
{
"use_class": "RS-[XX]",
"use_class_note": "Data is consented for research onParkinson's disease",
"use_restriction_rule": "CONSTRAINTS"
"use_class_note": "Data is consented for research on Parkinson's disease",
"use_restriction_rule": "CONSTRAINED_PERMISSION"
},
{
"use_class": "GS-[XX]",
"use_class_note": "Data is consented for sharing outside institute (Within Luxembourg)",
"use_restriction_rule": "CONSTRAINTS"
"use_restriction_rule": "CONSTRAINED_PERMISSION"
}
]
},
Expand All @@ -370,12 +370,12 @@
{
"use_class": "PUB",
"use_class_note": "Acknowledgement required.",
"use_restriction_rule": "CONSTRAINTS"
"use_restriction_rule": "OBLIGATION"
},
{
"use_class": "TS-[XX]",
"use_class_note": "Data is obtained for a limited duration. 2021-02-28",
"use_restriction_rule": "CONSTRAINTS"
"use_restriction_rule": "OBLIGATION"
}
]
}
Expand Down
10 changes: 5 additions & 5 deletions data/demo/datasets.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@
{
"use_class": "COL-[XX]",
"use_class_note": "Data is shared as part of the LUX-Epigen programme, a collaboration with CHL, IBBL, LCSB and LSRU.",
"use_restriction_rule": "CONSTRAINTS"
"use_restriction_rule": "OBLIGATION"
},
{
"use_class": "DS-[XX](CC)",
"use_class_note": "Data is consented for cancer research studies only.",
"use_restriction_rule": "CONSTRAINTS"
"use_restriction_rule": "CONSTRAINED_PERMISSION"
},
{
"use_class": "GS-[XX]",
"use_class_note": "Data is consented for sharing outside EU/EEA region.",
"use_restriction_rule": "CONSTRAINTS"
"use_restriction_rule": "PERMISSION"
}
]
}
Expand Down Expand Up @@ -96,12 +96,12 @@
{
"use_class": "PUB",
"use_class_note": "Acknowledgement required.",
"use_restriction_rule": "CONSTRAINTS"
"use_restriction_rule": "OBLIGATION"
},
{
"use_class": "TS-[XX]",
"use_class_note": "Data is obtained for a limited duration. 2022-02-28",
"use_restriction_rule": "CONSTRAINTS"
"use_restriction_rule": "OBLIGATION"
}
]
}
Expand Down