重构用户权限

This commit is contained in:
2025-09-25 18:41:23 +08:00
parent 8436a4602f
commit a6d76a64c4
7 changed files with 72 additions and 58 deletions

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