2016-11-14 104 views
2

我用模糊管理员来开发Web应用程序如何通过许可服务来隐藏菜单和路线

,我有服务检查权限为每个用户

我怎么可以在pages.module经许可服务隐藏菜单.js和LVS.module.js

ps。我可怜的英语。

我的代码

App.js:

'use strict'; 

var app = angular.module('BlurAdmin', [ 
    'ngAnimate', 
    'ui.bootstrap', 
    'ui.sortable', 
    'ui.router', 
    'ngTouch', 
    'toastr', 
    'smart-table', 
    "xeditable", 
    'ui.slimscroll', 
    'ngJsTree', 
    'angular-progress-button-styles', 

    'BlurAdmin.theme', 
    'BlurAdmin.pages', 
    'ngRoute', 
    'ngCookies', 
]) 
; 

pages.module.js:

(function() { 
    'use strict'; 

    angular.module('BlurAdmin.pages', [ 
    'ui.router', 

    'BlurAdmin.pages.dashboard', 
    'BlurAdmin.pages.ui', 
    'BlurAdmin.pages.components', 
    'BlurAdmin.pages.form', 
    'BlurAdmin.pages.tables', 
    'BlurAdmin.pages.charts', 
    'BlurAdmin.pages.maps', 
    'BlurAdmin.pages.profile', 

    'BlurAdmin.pages.Base', 
    'BlurAdmin.pages.Common', 
    'BlurAdmin.pages.Home', 
    'BlurAdmin.pages.MSS', 
    'BlurAdmin.pages.LVS', 
    'BlurAdmin.pages.SHS', 
    'BlurAdmin.pages.OTS', 
    'BlurAdmin.pages.TCS', 
    ]) 
     .config(routeConfig).run(run); 

    /** @ngInject */ 
    function routeConfig($urlRouterProvider, baSidebarServiceProvider) { 
    $urlRouterProvider 
     .otherwise('Login'); 

    } 
})(); 

LVS.module.js:

(function() { 
    'use strict'; 

    angular.module('BlurAdmin.pages.LVS', [ 
    ]) 
     .config(routeConfig); 

    /** @ngInject */ 
    function routeConfig($stateProvider) { 
    $stateProvider 
     .state('LVS', { 
      url: '/Leave', 
      template : '<ui-view></ui-view>', 
      //controller: 'LeaveManagementCtrl', 
      abstract: true, 
      title: 'Leave Management', 
      sidebarMeta: { 
      icon: 'ion-android-calendar', 
      order: 30, 
      }, 
      resolve: { 
      user: function (AuthService, $q) { 
       var d = $q.defer(); 
       if (AuthService.isAuthenticated()) { 
       // I also provide the user for child controllers 
       d.resolve(AuthService.UserDomain()); 
       } else { 
       // here the rejection 
       d.reject('not logged'); 
       } 
       return d.promise; 
      } 
      }, 
     }) 
     .state('LVS.LeaveList', { 
      url: '/List', 
      templateUrl: 'app/pages/ESS-TA/LeaveManagement/LeaveList.html', 
      controller: 'LVSCtrl', 
      title: 'Leave List', 
      params: { 
      obj: null, 
      }, 
      sidebarMeta: { 
      order: 10, 
      }, 
     }) 
     .state('LVS.LeaveReport', { 
      url: '/Report', 
      templateUrl: 'app/pages/ESS-TA/LeaveManagement/LeaveReport.html', 
      title: 'Leave Report', 
      sidebarMeta: { 
      order: 30, 
      }, 
     }); 
    } 

})(); 

回答

0

我发现这对githut蓝色的管理问题

https://github.com/akveo/blur-admin/issues/141

+0

一个潜在的解决方案的链接永远是受欢迎的,但请[添加各地的联系上下文(http://meta.stackoverflow.com/ a/8259/169503),所以你的同行们会有一些想法是什么,为什么它在那里。如果目标网站无法访问或永久离线,请始终引用重要链接中最相关的部分。考虑到_barely不仅仅是一个链接到外部网站_是一个可能的原因[为什么和如何删除一些答案?](http://stackoverflow.com/help/deleted-answers)。 –

相关问题