#2623 Make it possible to view currently valid simulation requests

This commit is contained in:
Marek Wolan
2024-07-08 15:17:35 +01:00
parent 2a0695d0d1
commit cbf54d442c
2 changed files with 26 additions and 7 deletions

View File

@@ -52,6 +52,8 @@ class GroupMembershipValidator(RequestPermissionValidator):
def __call__(self, request: List[str], context: Dict) -> bool:
"""Permit the action if the request comes from an account which belongs to the right group."""
# if context request source is part of any groups mentioned in self.allow_groups, return true, otherwise false
if not context:
return False
requestor_groups: List[str] = context["request_source"]["groups"]
for allowed_group in self.allowed_groups:
if allowed_group.name in requestor_groups: