From 48a2996f45210da2d4a3c34851b57e6aae87a03d Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 10 Jun 2013 11:45:21 +0200 Subject: [PATCH] Added permission check for redirect after create. --- .../app/controllers/agent_ticket_create.js.coffee | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee index 65bc3e029..5284f0a65 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee @@ -313,7 +313,15 @@ class App.TicketCreate extends App.Controller # scroll to top ui.scrollTo() - ui.navigate "#ticket/zoom/#{@id}" + # access to group + session = App.Session.all() + if session && session['group_ids'] && _.contains(session['group_ids'], @group_id) + ui.navigate "#ticket/zoom/#{@id}" + return + + # if not, show start screen + ui.navigate "#" + error: -> ui.log 'save failed!'