|
|
|
@ -6,48 +6,48 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo
|
|
|
|
|
var app = angular.module('managerMainAppv2', ['ngSanitize', 'ngAnimate', 'ngMessages', 'ui.router', 'ui.bootstrap', 'ngFileUpload']);
|
|
|
|
|
app.config(['$urlRouterProvider', '$httpProvider', function ($urlRouterProvider, $httpProvider) {
|
|
|
|
|
|
|
|
|
|
var getRoleMenulist = function () {
|
|
|
|
|
var getRoleMenulist = function (role) {
|
|
|
|
|
var roleMenu = [];
|
|
|
|
|
|
|
|
|
|
if ((window.currentUser.role.toString(2) & 1) >0){
|
|
|
|
|
if ((role & 1) >0){
|
|
|
|
|
roleMenu.push("administrator");
|
|
|
|
|
}
|
|
|
|
|
if ((window.currentUser.role.toString(2) & 10) >0){
|
|
|
|
|
if ((role & 2) >0){
|
|
|
|
|
roleMenu.push("compliance");
|
|
|
|
|
}
|
|
|
|
|
if ((window.currentUser.role.toString(2) & 100) >0){
|
|
|
|
|
if ((role & 4) >0){
|
|
|
|
|
roleMenu.push("bduser");
|
|
|
|
|
}
|
|
|
|
|
if ((window.currentUser.role.toString(2) & 1000) >0){
|
|
|
|
|
if ((role & 8) >0){
|
|
|
|
|
roleMenu.push("accountant");
|
|
|
|
|
}
|
|
|
|
|
if ((window.currentUser.role.toString(2) & 1000000) >0){
|
|
|
|
|
if ((role & 64) >0){
|
|
|
|
|
roleMenu.push("director");
|
|
|
|
|
}
|
|
|
|
|
if ((window.currentUser.role.toString(2) & 10000000) >0){
|
|
|
|
|
if ((role & 128) >0){
|
|
|
|
|
roleMenu.push("sitemanager");
|
|
|
|
|
}
|
|
|
|
|
if ((window.currentUser.role.toString(2) & 100000000) >0){
|
|
|
|
|
if ((role & 256) >0){
|
|
|
|
|
roleMenu.push("developer");
|
|
|
|
|
}
|
|
|
|
|
if ((window.currentUser.role.toString(2) & 1000000000) >0){
|
|
|
|
|
if ((role & 1024) >0){
|
|
|
|
|
roleMenu.push("riskmanager");
|
|
|
|
|
}
|
|
|
|
|
if ((window.currentUser.role.toString(2) & 100000000000) >0){
|
|
|
|
|
if ((role & 2048) >0){
|
|
|
|
|
roleMenu.push("guest");
|
|
|
|
|
}
|
|
|
|
|
if ((window.currentUser.role.toString(2) & 10000000000000) >0){
|
|
|
|
|
if ((role & 8192) >0){
|
|
|
|
|
roleMenu.push("salesmanager");
|
|
|
|
|
}
|
|
|
|
|
return roleMenu;
|
|
|
|
|
};
|
|
|
|
|
if (getRoleMenulist().length>1) {
|
|
|
|
|
if (getRoleMenulist(window.currentUser.role).length>1) {
|
|
|
|
|
sessionStorage.setItem('roleNum','N');
|
|
|
|
|
$urlRouterProvider.otherwise(((window.currentUser.role & parseInt('100000', 2)) > 0) ? '/managers' : '/home');
|
|
|
|
|
}else {
|
|
|
|
|
sessionStorage.setItem('roleNum','1');
|
|
|
|
|
sessionStorage.setItem('role',getRoleMenulist().valueOf());
|
|
|
|
|
$urlRouterProvider.otherwise(((window.currentUser.role & parseInt('100000', 2)) > 0) ? '/managers' : '/menu?role=' + getRoleMenulist().valueOf());
|
|
|
|
|
sessionStorage.setItem('role',getRoleMenulist(window.currentUser.role).valueOf());
|
|
|
|
|
$urlRouterProvider.otherwise(((window.currentUser.role & parseInt('100000', 2)) > 0) ? '/managers' : '/menu?role=' + getRoleMenulist(window.currentUser.role).valueOf());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|