Skip to content

Commit 693e8bc

Browse files
committed
fixup! 🔒️(back) don't allow an owner to change or delete other owner accesses
1 parent 3288d5f commit 693e8bc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎src/backend/core/tests/documents/test_api_document_accesses.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ def test_api_document_accesses_delete_other_owners(via, mock_user_teams):
10221022

10231023

10241024
@pytest.mark.parametrize("via", VIA)
1025-
def test_api_document_accesses_delete_self_owner_if_other_owner_exists(via):
1025+
def test_api_document_accesses_delete_self_owner_if_other_owner_exists(via, mock_reset_connections):
10261026
"""
10271027
A user should be able to delete their own ownership access if there is another owner in the
10281028
document.
@@ -1047,10 +1047,10 @@ def test_api_document_accesses_delete_self_owner_if_other_owner_exists(via):
10471047
models.DocumentAccess.objects.filter(document=document, role="owner").count()
10481048
== 2
10491049
)
1050-
1051-
response = client.delete(
1052-
f"/api/v1.0/documents/{document.id!s}/accesses/{access.id!s}/",
1053-
)
1050+
with mock_reset_connections(document.id, str(access.user_id)):
1051+
response = client.delete(
1052+
f"/api/v1.0/documents/{document.id!s}/accesses/{access.id!s}/",
1053+
)
10541054

10551055
assert response.status_code == 204
10561056
assert (

0 commit comments

Comments
 (0)