1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-29 18:52:22 +01:00

update version on user login according to their role

This commit is contained in:
Sylvain 2016-09-22 17:01:40 +02:00
parent 6401b321ef
commit 205c45060a

View File

@ -26,6 +26,11 @@ Application.Controllers.controller 'ApplicationController', ["$rootScope", "$sco
$rootScope.currentUser = user
Session.create(user);
getNotifications()
# fab-manager's app-version
if user.role == 'admin'
$scope.version = Version.get()
else
$scope.version = {version: ''}
##
@ -209,10 +214,9 @@ Application.Controllers.controller 'ApplicationController', ["$rootScope", "$sco
# try to retrieve any currently logged user
Auth.login().then (user) ->
$scope.setCurrentUser(user)
# force users to complete their profile if they are not
if user.need_completion
$state.transitionTo('app.logged.profileCompletion')
if user.role == 'admin'
$scope.version = Version.get()
, (error) ->
# Authentication failed...
$rootScope.toCheckNotifications = false