Skip to content
Snippets Groups Projects
Verified Commit d5e7709e authored by Timm Fitschen's avatar Timm Fitschen
Browse files

TST: fix broken tests in test_state.py

parent caefa284
No related branches found
No related tags found
2 merge requests!31Tests for caosdb-server#223,!30F parse acl
Pipeline #20584 passed
......@@ -111,7 +111,7 @@ def setup_module():
"ACL": None})
state_acl = db.ACL()
state_acl.grant(role="role1", permission="UPDATE:DESCRIPTION")
state_acl.deny(role="anonymous", permission="*")
state_acl.deny(role="anonymous", permission="RETRIEVE:ENTITY")
state_acl = db.State.create_state_acl(state_acl)
st1.acl = state_acl.combine(st1.acl)
st1.update_acl()
......@@ -483,10 +483,14 @@ def test_transfer_state_acl():
rec.state = db.State(model="Model1", name="State1")
insert_rec = rec.insert(flags={"ACL": None})
state_acl = db.ACL().combine(db.get_global_acl())
state_acl = db.ACL()
state_acl.grant(role="role1", permission="UPDATE:DESCRIPTION")
state_acl.deny(role="anonymous", permission="RETRIEVE:ENTITY")
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 == state_acl
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment