Make k-space:janitors able to edit all items
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Madis Mägi 2024-08-25 15:13:44 +03:00
parent 68f65fc8eb
commit 3c1e0edbf2

View File

@ -149,7 +149,7 @@ def check_edit_permission(item_id):
user_groups = user.get("groups", [])
if item.get("type") == "key" and "k-space:janitors" not in user_groups:
return False
if any(group in user_groups for group in ["k-space:board", "k-space:kubernetes:admins"]):
if any(group in user_groups for group in ["k-space:board", "k-space:kubernetes:admins", "k-space:janitors"]):
return True
item_username = item.get("inventory", {}).get("owner", {}).get("username", False)
user_username = user.get("username", False)