Skip to content

Instantly share code, notes, and snippets.

@VladimirPal
Created March 13, 2015 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VladimirPal/dc66fc85c29e294c39f8 to your computer and use it in GitHub Desktop.
Save VladimirPal/dc66fc85c29e294c39f8 to your computer and use it in GitHub Desktop.
module.exports = class MainController extends Marionette.Object
queuMethod: false
initialize: ->
App.vent.on 'profile:ready', () =>
if @queuMethod
@[@queuMethod](@queuArgs)
@queuMethod = false
dashboard: ->
roles = App.request('data:profile').get('roles')
if roles?
if "admin" in roles
@dashboardAdmin()
else
@dashboardClient()
else
@queuMethod = 'dashboard'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment