Skip to content

Commit f489b5b

Browse files
authored
Merge pull request #24 from Munich-Quantum-Software-Stack/th/feat/restrict_eqe_user
Correct feature's implement: block users who are not in EQE group to resource EQE1
2 parents 34e4395 + 3724f4c commit f489b5b

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

bqp_database_access/resources.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ def fetch_resource_names_restricted_to_identity(identity: str) -> list[str]:
102102
restricted_resource_names.append("Q5")
103103
restricted_resource_names.append("Q20")
104104
restricted_resource_names.append("QExa20")
105-
elif "EQE" in _user_group_names:
105+
106+
if "EQE" not in _user_group_names:
106107
# block access to EQE1 device
107108
restricted_resource_names.append("EQE1")
108109

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ requires-python = ">=3.10,<3.12"
1313
readme = "README.md"
1414
license = { text = "MIT" }
1515

16+
[tool.setuptools]
17+
packages = ["bqp_database_access"]
18+
1619
[project.optional-dependencies]
1720
dev = [
1821
"black>=25.1.0",

tests/test_resources.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ def test_fetch_resource_names_restricted_to_identity_in_EQE_group(seeded_db):
1212
identity = "test_eqe_user"
1313
with db_session:
1414
restricted_resources = fetch_resource_names_restricted_to_identity(identity=identity)
15-
assert("EQE1" in restricted_resources)
15+
assert("EQE1" not in restricted_resources)
1616

1717
def test_fetch_resource_names_restricted_to_identity_not_in_EQE_group(seeded_db):
1818
identity = "test_user"
1919
with db_session:
2020
restricted_resources = fetch_resource_names_restricted_to_identity(identity=identity)
21-
assert("EQE1" not in restricted_resources)
21+
assert("EQE1" in restricted_resources)

0 commit comments

Comments
 (0)