1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-06 01:08:21 +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 $rootScope.currentUser = user
Session.create(user); Session.create(user);
getNotifications() 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 # try to retrieve any currently logged user
Auth.login().then (user) -> Auth.login().then (user) ->
$scope.setCurrentUser(user) $scope.setCurrentUser(user)
# force users to complete their profile if they are not
if user.need_completion if user.need_completion
$state.transitionTo('app.logged.profileCompletion') $state.transitionTo('app.logged.profileCompletion')
if user.role == 'admin'
$scope.version = Version.get()
, (error) -> , (error) ->
# Authentication failed... # Authentication failed...
$rootScope.toCheckNotifications = false $rootScope.toCheckNotifications = false