重构用户权限
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user