Skip to content
Permalink
Browse files

fix(api): v1 for group changes

  • Loading branch information...
polonel committed Apr 30, 2019
1 parent 969d3f2 commit 3d126676095b3b59a0fb21fd12694ce185c58253
Showing with 10 additions and 3 deletions.
  1. +10 −3 src/controllers/api/v1/tickets.js
@@ -154,13 +154,20 @@ apiTickets.get = function (req, res) {

var ticketModel = require('../../../models/ticket')
var groupModel = require('../../../models/group')
var departmentModel = require('../../../models/department')

async.waterfall(
[
function (callback) {
groupModel.getAllGroupsOfUserNoPopulate(user._id, function (err, grps) {
callback(err, grps)
})
if (user.role.isAdmin || user.role.isAgent) {
departmentModel.getDepartmentGroupsOfUser(user._id, function (err, groups) {
callback(err, groups)
})
} else {
groupModel.getAllGroupsOfUserNoPopulate(user._id, function (err, grps) {
callback(err, grps)
})
}
},
function (grps, callback) {
if (permissions.canThis(user.role, 'tickets:public')) {

0 comments on commit 3d12667

Please sign in to comment.
You can’t perform that action at this time.