Skip to content

Commit

Permalink
fix(core): Correct ticket comment permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-nfc committed Aug 31, 2024
1 parent 28fe89e commit 8242d9f
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions app/core/views/ticket_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from access.mixin import OrganizationPermission

from core.forms.ticket_comment import CommentForm, DetailForm
from core.models.ticket.ticket_comment import TicketComment
from core.models.ticket.ticket_comment import TicketComment, Ticket
from core.views.common import AddView, ChangeView, DeleteView, IndexView

from settings.models.user_settings import UserSettings
Expand All @@ -20,12 +20,22 @@ class Add(AddView):
form_class = CommentForm

model = TicketComment
permission_required = [
'itam.add_device',
]

parent_model = Ticket

parent_model_pk_kwarg = 'ticket_id'

template_name = 'form.html.j2'


def get_dynamic_permissions(self):

return [
str('core.add_ticketcomment'),
]



def get_initial(self):

initial_values: dict = {
Expand Down Expand Up @@ -72,9 +82,13 @@ class Change(ChangeView):

model = TicketComment

permission_required = [
'itim.change_cluster',
]


def get_dynamic_permissions(self):

return [
str('core.change_ticketcomment'),
]


def get_context_data(self, **kwargs):
Expand Down

0 comments on commit 8242d9f

Please sign in to comment.