Browse Source

admin redirect to hosts if has permission

develop
Robin Thoni 9 years ago
parent
commit
fed8b60ff5
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      admin/controllers/home.controller.js

+ 4
- 1
admin/controllers/home.controller.js View File

2
     .controller('HomeController', ['$scope', '$state', 'luticateAuthCache',
2
     .controller('HomeController', ['$scope', '$state', 'luticateAuthCache',
3
         function($scope, $state, luticateAuthCache) {
3
         function($scope, $state, luticateAuthCache) {
4
 
4
 
5
-            if (luticateAuthCache.hasEffectivePermission("CAMOTION_CAMERA_GET")) {
5
+            if (luticateAuthCache.hasEffectivePermission("CAMOTION_HOST_GET")) {
6
+                $state.go('hosts');
7
+            }
8
+            else if (luticateAuthCache.hasEffectivePermission("CAMOTION_CAMERA_GET")) {
6
                 $state.go('cameras');
9
                 $state.go('cameras');
7
             }
10
             }
8
             else if (luticateAuthCache.hasEffectivePermission("CAMOTION_SENSOR_GET")) {
11
             else if (luticateAuthCache.hasEffectivePermission("CAMOTION_SENSOR_GET")) {

Loading…
Cancel
Save