Skip to content
Snippets Groups Projects
Commit 6505d304 authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

AUDIT: Review test_state.py::test_missing_retrieve_permission

parent d5e7709e
Branches
Tags
1 merge request!31Tests for caosdb-server#223
Pipeline #20707 passed
# encoding: utf-8
#
# This file is a part of the CaosDB Project.
#
# Copyright (C) 2020-2022 IndiScale GmbH <info@indiscale.com>
# Copyright (C) 2020-2022 Timm Fitschen <t.fitschen@indiscale.com>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# ** end header
#
import pytest
import caosdb as db
from caosdb import administration as admin
......@@ -489,8 +511,10 @@ def test_transfer_state_acl():
state_acl = state_acl.combine(db.get_global_acl())
# the acl has been transfered from the state record
assert insert_rec.acl.get_permissions_for_role("role1") == {"UPDATE:DESCRIPTION"}
assert "RETRIEVE:ENTITY" not in insert_rec.acl.get_permissions_for_role("anonymous")
assert insert_rec.acl.get_permissions_for_role("role1") == {
"UPDATE:DESCRIPTION"}
assert "RETRIEVE:ENTITY" not in insert_rec.acl.get_permissions_for_role(
"anonymous")
assert insert_rec.acl == state_acl
......@@ -817,6 +841,7 @@ def test_transitions_included_after_empty_update():
def test_missing_retrieve_permission():
"""When the retrieve permission is missing, the state must not be leaked."""
# @review Florian Spreckelsen 2022-03-22
rec = db.Record()
rec.description = "old description"
rec.add_parent("TestRT")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment