Skip to content

Commit

Permalink
Allowing project owners and delegates to import cases via API (#207).
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored and stolpeo committed Nov 29, 2021
1 parent cf0909d commit 360c24b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions HISTORY.rst
Expand Up @@ -17,6 +17,7 @@ End-User Summary
- Fixed recompute of variant stats of large small variant sets.
- Added index for ``SmallVariant`` model filtering for ``case_id`` and ``set_id``.
This may take a while!
- Allowing project owners and delegates to import cases via API (#207).

Full Change List
================
Expand All @@ -33,6 +34,7 @@ Full Change List
- Fixed recompute of variant stats of large small variant sets.
- Added index for ``SmallVariant`` model filtering for ``case_id`` and ``set_id``.
This may take a while!
- Allowing project owners and delegates to import cases via API (#207).

-------
v0.23.9
Expand Down
16 changes: 9 additions & 7 deletions importer/rules.py
Expand Up @@ -12,18 +12,20 @@

# Rules ------------------------------------------------------------------------


rules.add_perm(
"importer.view_import",
is_allowed_to_modify = (
rules.is_superuser
| pr_rules.is_project_owner
| pr_rules.is_project_delegate
| pr_rules.is_project_contributor,
| pr_rules.is_project_contributor
)

rules.add_perm(
"importer.view_import", is_allowed_to_modify,
)

rules.add_perm("importer.add_import", rules.is_superuser | pr_rules.is_project_contributor)
rules.add_perm("importer.delete_import", rules.is_superuser | pr_rules.is_project_contributor)
rules.add_perm("importer.update_import", rules.is_superuser | pr_rules.is_project_contributor)
rules.add_perm("importer.add_import", is_allowed_to_modify)
rules.add_perm("importer.delete_import", is_allowed_to_modify)
rules.add_perm("importer.update_import", is_allowed_to_modify)

# Permissions ------------------------------------------------------------------

Expand Down

0 comments on commit 360c24b

Please sign in to comment.