Cleanup of redirect to admin interface if user is only admin and no agent or customer (only one central place).
This commit is contained in:
parent
db531e66b3
commit
7f8e268ae0
2 changed files with 8 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue