1234567891011121314151617181920 |
- angular.module('camotionAdmin')
- .controller('HomeController', ['$scope', '$state', 'luticateAuthCache',
- function($scope, $state, luticateAuthCache) {
-
- if (luticateAuthCache.hasEffectivePermission("CAMOTION_HOST_GET")) {
- $state.go('hosts');
- }
- else if (luticateAuthCache.hasEffectivePermission("CAMOTION_CAMERA_GET")) {
- $state.go('cameras');
- }
- else if (luticateAuthCache.hasEffectivePermission("CAMOTION_SENSOR_GET")) {
- $state.go('sensors');
- }
- else if (luticateAuthCache.hasEffectivePermission("CAMOTION_COMMAND_GET")) {
- $state.go('commands');
- }
- else {
- $state.go('login');
- }
- }]);
|