Skip to content

Commit

Permalink
Fix can_edit_organization to check edit_all_organization permission
Browse files Browse the repository at this point in the history
  • Loading branch information
hieplpvip committed Sep 23, 2023
1 parent 79ce809 commit ff84d71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions judge/views/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def can_edit_organization(self, org=None):
org = self.object
if not self.request.user.is_authenticated:
return False
return org.is_admin(self.request.profile)
return org.is_admin(self.request.profile) or self.request.user.has_perm('judge.edit_all_organization')


class BaseOrganizationListView(OrganizationMixin, ListView):
Expand Down Expand Up @@ -451,7 +451,7 @@ def can_edit_organization(self, org=None):
org = self.organization
if not self.request.user.is_authenticated:
return False
return org.is_admin(self.request.profile)
return org.is_admin(self.request.profile) or self.request.user.has_perm('judge.edit_all_organization')


class CustomAdminOrganizationMixin(CustomOrganizationMixin):
Expand Down

0 comments on commit ff84d71

Please sign in to comment.