share submission

This commit is contained in:
virusdefender
2019-03-13 17:57:41 +08:00
parent d969c6fe5e
commit 8cdc4acaaf
4 changed files with 21 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ class Submission(models.Model):
def check_user_permission(self, user, check_share=True):
return self.user_id == user.id or \
(check_share and self.shared is True) or \
(check_share and self.problem.share_submission) or \
user.is_super_admin() or \
user.can_mgmt_all_problem() or \
self.problem.created_by_id == user.id