Skip to content
Permalink
Browse files

Cleanup of redirect to admin interface if user is only admin and no a…

…gent or customer (only one central place).
  • Loading branch information...
znuny-robo committed Jun 7, 2019
1 parent db531e6 commit 7f8e268ae0d69252fa10d9813da801e6959042f7
@@ -69,8 +69,14 @@ class App.Dashboard extends App.Controller

show: (params) =>

if @permissionCheck('ticket.customer')
@navigate '#', true
# incase of being only customer, redirect to default router
if @permissionCheck('ticket.customer') && !@permissionCheck('ticket.agent')
@navigate '#ticket/view', true
return

# incase of being only admin, redirect to admin interface (show no empty white content page)
if !@permissionCheck('ticket.customer') && !@permissionCheck('ticket.agent') && @permissionCheck('admin')
@navigate '#manage', true
return

# set title
@@ -17,11 +17,6 @@ class DefaultRouter extends App.Controller
@navigate '#getting_started', true
return

# check role
if @permissionCheck('ticket.customer')
@navigate '#ticket/view/my_tickets', true
return

if @Config.get('default_controller')
@navigate @Config.get('default_controller'), true
return

0 comments on commit 7f8e268

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