重构用户权限

This commit is contained in:
xuyue committed 2025-09-25 18:41:23 +08:00
1 parent 8436a4602f
commit a6d76a64c4
7 files changed
+72 -58

No files matched your search

+1 -2
View File
@@ -43,8 +43,7 @@ class Submission(models.Model):
def check_user_permission(self, user, check_share=True):
if (
self.user_id == user.id
or user.is_super_admin()
or user.can_mgmt_all_problem()
or not user.is_regular_user()
or self.problem.created_by_id == user.id
):
return True
+1 -1
View File
@@ -176,7 +176,7 @@ class SubmissionListAPI(APIView):
if (
not SysOptions.submission_list_show_all
and not request.user.is_super_admin()
and request.user.is_regular_user()
):
return self.success({"results": [], "total": 0})