修复一系列超级管理员无法操作其他用户比赛和题目的问题
This commit is contained in:
1 parent
a2332b78cd
commit
4d3a4d1c6e
2 files changed
+45
-25
No files matched your search
@@ -110,6 +110,8 @@ def ensure_created_by(obj, user):
|
||||
e = APIError(msg=f"{obj.__class__.__name__} does not exist")
|
||||
if not user.is_admin_role():
|
||||
raise e
|
||||
if user.is_super_admin():
|
||||
return
|
||||
if isinstance(obj, Problem):
|
||||
if not user.can_mgmt_all_problem() and obj.created_by != user:
|
||||
raise e
|
||||
|
||||
Reference in new issue
Block a user