access denied fix
This commit is contained in:
@@ -38,6 +38,10 @@ def user_has_test_access(user_id: str, test_id: str) -> AccessResult:
|
||||
if is_test_author(test.created_by, uid):
|
||||
return AccessResult(ok=True, is_author=True, not_found=False)
|
||||
|
||||
# Глобальная политика доступа: любой активный тест доступен всем сотрудникам.
|
||||
if bool(test.is_active):
|
||||
return AccessResult(ok=True, is_author=False, not_found=False)
|
||||
|
||||
assigned = session.query(
|
||||
exists().where(
|
||||
TestAssignmentTarget.target_type == 'user',
|
||||
|
||||
Reference in New Issue
Block a user