diff --git a/src/controllers/tickets.js b/src/controllers/tickets.js
index c0772eaaf..f24eebe66 100644
--- a/src/controllers/tickets.js
+++ b/src/controllers/tickets.js
@@ -477,7 +477,9 @@ ticketsController.single = function (req, res) {
async.waterfall(
[
function (next) {
- if (!req.user.role.isAdmin && !req.user.role.isAgent) return next(null, ticket.group.members)
+ if (!req.user.role.isAdmin && !req.user.role.isAgent) {
+ return groupSchema.getAllGroupsOfUserNoPopulate(req.user._id, next)
+ }
departmentSchema.getUserDepartments(req.user._id, function (err, departments) {
if (err) return next(err)
diff --git a/src/views/subviews/singleticket.hbs b/src/views/subviews/singleticket.hbs
index 883e8ffd4..3f47404cc 100644
--- a/src/views/subviews/singleticket.hbs
+++ b/src/views/subviews/singleticket.hbs
@@ -23,7 +23,11 @@
New
{{/hasPermOverRole}}
{{else}}
- New
+ {{#hasPermOverRole data.ticket.owner.role data.common.loggedInAccount.role "tickets:update"}}
+ New
+ {{else}}
+ New
+ {{/hasPermOverRole}}
{{/canUserOrAdmin}}
{{/is}}
{{#is data.ticket.status 1}}
@@ -34,7 +38,11 @@
Open
{{/hasPermOverRole}}
{{else}}
- Open
+ {{#hasPermOverRole data.ticket.owner.role data.common.loggedInAccount.role "tickets:update"}}
+ Open
+ {{else}}
+ Open
+ {{/hasPermOverRole}}
{{/canUserOrAdmin}}
{{/is}}
{{#is data.ticket.status 2}}
@@ -45,7 +53,11 @@
Pending
{{/hasPermOverRole}}
{{else}}
- Pending
+ {{#hasPermOverRole data.ticket.owner.role data.common.loggedInAccount.role "tickets:update"}}
+ Pending
+ {{else}}
+ Pending
+ {{/hasPermOverRole}}
{{/canUserOrAdmin}}
{{/is}}
{{#is data.ticket.status 3}}
@@ -56,7 +68,11 @@
Closed
{{/hasPermOverRole}}
{{else}}
- Closed
+ {{#hasPermOverRole data.ticket.owner.role data.common.loggedInAccount.role "tickets:update"}}
+ Closed
+ {{else}}
+ Closed
+ {{/hasPermOverRole}}
{{/canUserOrAdmin}}
{{/is}}
keyboard_arrow_down