Skip to content

Commit

Permalink
Merge pull request #743 from dbmi-bgm/drr_purge_fix
Browse files Browse the repository at this point in the history
Purge permissions fix
  • Loading branch information
drio18 authored Aug 3, 2023
2 parents a1947dc + 3b98811 commit 81adff9
Show file tree
Hide file tree
Showing 7 changed files with 867 additions and 813 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ cgap-portal
Change Log
----------

14.1.1
======
`PR 743: Purge permissions fix <https://github.com/dbmi-bgm/cgap-portal/pull/743>`_

* Update set_user_info_property to true to allow admins to purge items
* Bring in updated snovault to fix impersonation bug


14.1.0
======
`PR 739: Bm babel updates <https://github.com/dbmi-bgm/cgap-portal/pull/739>`_
Expand Down
1,648 changes: 844 additions & 804 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
# Note: Various modules refer to this system as "encoded", not "cgap-portal".
name = "encoded"
version = "14.1.0"
version = "14.1.1"
description = "Computational Genome Analysis Platform"
authors = ["4DN-DCIC Team <[email protected]>"]
license = "MIT"
Expand Down Expand Up @@ -49,7 +49,7 @@ codeguru-profiler-agent = "^1.2.4"
cryptography = "39.0.2"
colorama = "0.3.3"
dcicpyvcf = "1.0.0.1b0" # "^1.0.0"
dcicsnovault = "9.0.0"
dcicsnovault = "9.1.1"
#dcicutils = "^7.4.0"
#dcicutils = "7.4.4.5b21"
dcicutils = "^7.5.0"
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/commands/owltools.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def get_last_bit(uri_string):

def isBlankNode(aClass):
''' Checks for an RDF blank node '''
if type(aClass) == BNode:
if type(aClass) is BNode:
return True
else:
return False
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/project/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def login(self, context, request, *, samesite):
return super().login(context, request, samesite=samesite)

def namespaced_authentication_policy_authenticated_userid(self, namespaced_authentication_policy, request, set_user_info_property):
set_user_info_property = False
set_user_info_property = True
return super().namespaced_authentication_policy_authenticated_userid(namespaced_authentication_policy, request, set_user_info_property)

def note_auth0_authentication_policy_unauthenticated_userid(self, auth0_authentication_policy, request, email, id_token):
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/search/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ def build_table_columns(self):
type_infos = [self.request.registry[TYPES][t] for t in self.doc_types if t != 'Item']
for ti in type_infos:
# We use `type` instead of `isinstance` since we don't want to catch subclasses.
if type(ti) == AbstractTypeInfo:
if type(ti) is AbstractTypeInfo:
any_abstract_types = True
break

Expand Down
14 changes: 10 additions & 4 deletions src/encoded/tests/test_permissions.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from typing import Any, Dict

import pytest
# import webtest
from webtest.app import TestApp

# from datetime import date
# from urllib.parse import urlencode
# from ..types.institution import Institution
from .datafixtures import remote_user_testapp
from .utils import get_identifier_path


pytestmark = [pytest.mark.setone, pytest.mark.working, pytest.mark.schema]
Expand Down Expand Up @@ -461,3 +461,9 @@ def test_public_item_wo_project_can_be_posted_by_project_member(bgm_user_testapp
# need to have a uniquename
to_post['name'] = 'another section name'
bgm_user_testapp.post_json('/static_section', to_post, status=201)


def test_admin_can_purge(testapp: TestApp, file: Dict[str, Any]) -> None:
file_path = get_identifier_path(file.get("uuid"))
testapp.patch_json(file_path, {"status": "deleted"}, status=200)
testapp.delete_json(f"{file_path}/?purge=True", {}, status=200)

0 comments on commit 81adff9

Please sign in to comment.