|
@@ -18,19 +18,19 @@ class SuperuserStaffRequiredMixin(UserPassesTestMixin):
|
|
|
class UserCanReadTicketListMixin(UserPassesTestMixin):
|
|
|
def test_func(self):
|
|
|
ticket_list = get_object_or_404(TicketList.objects.select_related('group'), pk=self.kwargs.get('pk'))
|
|
|
- return self.request.user.is_superuser or ticket_list.group in self.request.user.groups.all()
|
|
|
+ return ticket_list.group in self.request.user.groups.all()
|
|
|
|
|
|
|
|
|
class UserCanReadTicketMixin(UserPassesTestMixin):
|
|
|
def test_func(self):
|
|
|
ticket = get_object_or_404(Ticket.objects.select_related('ticket_list', 'ticket_list__group'), pk=self.kwargs.get('pk'))
|
|
|
- return self.request.user.is_superuser or ticket.ticket_list.group in self.request.user.groups.all() or ticket.assigned_to == self.request.user
|
|
|
+ return ticket.ticket_list.group in self.request.user.groups.all() or ticket.assigned_to == self.request.user
|
|
|
|
|
|
|
|
|
class UserCanWriteTicketMixin(UserPassesTestMixin):
|
|
|
def test_func(self):
|
|
|
ticket = get_object_or_404(Ticket.objects.all(), pk=self.kwargs.get('pk'))
|
|
|
- return self.request.user.is_superuser or self.request.user.is_staff or ticket.created_by == self.request.user
|
|
|
+ return ticket.created_by == self.request.user
|
|
|
|
|
|
|
|
|
def remove_attachment_file(attachment_id: int) -> bool:
|