Added permission check for redirect after create.

This commit is contained in:
Martin Edenhofer 2013-06-10 11:45:21 +02:00
parent d4068d9359
commit 48a2996f45

View file

@ -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!'