Skip to content

Commit

Permalink
Merge branch 'main' into fix/store/rm_user
Browse files Browse the repository at this point in the history
  • Loading branch information
ssiyad committed Sep 26, 2023
2 parents 1dca3af + ee7bc61 commit e9e943b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 3 additions & 5 deletions helpdesk/helpdesk/doctype/hd_ticket/hd_ticket.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
"icon": "fa fa-issue",
"idx": 61,
"links": [],
"modified": "2023-09-27 02:51:13.078952",
"modified": "2023-09-27 03:20:19.360900",
"modified_by": "Administrator",
"module": "Helpdesk",
"name": "HD Ticket",
Expand Down Expand Up @@ -401,16 +401,14 @@
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "All",
"share": 1,
"write": 1
"share": 1
}
],
"quick_entry": 1,
Expand All @@ -424,4 +422,4 @@
"title_field": "subject",
"track_changes": 1,
"track_seen": 1
}
}
10 changes: 10 additions & 0 deletions helpdesk/helpdesk/doctype/hd_ticket/hd_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,16 @@ def by_priority(query: Query, direction: Order):
"Last modified on": "modified",
}

def has_permission(self, perm):
has_standard_permissions = super().has_permission(perm)
user = frappe.session.user
customer = get_customer(user)
is_customer = self.customer == customer
is_contact = self.contact == user
is_raised = self.raised_by == user
has_extra_permissions = is_customer or is_contact or is_raised
return has_standard_permissions or has_extra_permissions

Check warning on line 159 in helpdesk/helpdesk/doctype/hd_ticket/hd_ticket.py

View check run for this annotation

Codecov / codecov/patch

helpdesk/helpdesk/doctype/hd_ticket/hd_ticket.py#L151-L159

Added lines #L151 - L159 were not covered by tests

def publish_update(self):
publish_event("helpdesk:ticket-update", {"name": self.name})
capture_event("ticket_updated")
Expand Down

0 comments on commit e9e943b

Please sign in to comment.