Pārlūkot izejas kodu

Merge branch 'fix/service_manager' into 'master'

代理和服务的访问权限修改为ServiceManager

See merge request o2oa/o2oa!2575

(cherry picked from commit f1d3be43553322bbf16cb956488e1b3b5ceafaed)

a33a5880 代理和服务的访问权限修改为ServiceManager
胡起 5 gadi atpakaļ
vecāks
revīzija
5953b1ea70

+ 6 - 2
o2web/source/o2_core/o2/xDesktop/Access.js

@@ -43,7 +43,11 @@ MWF.xDesktop.Access = MWF.AC = {
         this.getRoleList();
         return this.isAdministrator() || (this.roleList.indexOf("messagemanager")!==-1);
     },
-
+    isServiceManager: function(){
+        if (!layout.desktop.session.user.roleList) return false;
+        this.getRoleList();
+        return this.isAdministrator() || (this.roleList.indexOf("servicemanager")!==-1);
+    },
 
     isUnitManager: function(){
         if (!layout.desktop.session.user.roleList) return false;
@@ -202,4 +206,4 @@ MWF.xDesktop.Access = MWF.AC = {
         //if (!this.action) this.action = new MWF.xApplication.Organization.Actions.RestActions();
     }
 
-}
+}

+ 2 - 2
o2web/source/x_component_service_ServiceManager/AgentExplorer.js

@@ -13,7 +13,7 @@ MWF.xApplication.service.ServiceManager.AgentExplorer = new Class({
         }
     },
     createCreateElementNode: function(){
-        if( MWF.AC.isAdministrator() ) {
+        if( MWF.AC.isServiceManager() ) {
             this.createElementNode = new Element("div", {
                 "styles": this.css.createElementNode,
                 "title": this.options.tooltip.create
@@ -41,7 +41,7 @@ MWF.xApplication.service.ServiceManager.AgentExplorer = new Class({
         this.app.desktop.openApplication(e, "service.AgentDesigner", options);
     },
     loadElementList: function(){
-        if( MWF.AC.isAdministrator() ){
+        if( MWF.AC.isServiceManager() ){
             this._loadItemDataList(function(json){
                 if (json.data.length){
                     json.data.each(function(item){

+ 2 - 2
o2web/source/x_component_service_ServiceManager/InvokeExplorer.js

@@ -13,7 +13,7 @@ MWF.xApplication.service.ServiceManager.InvokeExplorer = new Class({
         }
     },
     createCreateElementNode: function(){
-        if( MWF.AC.isAdministrator() ) {
+        if( MWF.AC.isServiceManager() ) {
             this.createElementNode = new Element("div", {
                 "styles": this.css.createElementNode,
                 "title": this.options.tooltip.create
@@ -41,7 +41,7 @@ MWF.xApplication.service.ServiceManager.InvokeExplorer = new Class({
         this.app.desktop.openApplication(e, "service.InvokeDesigner", options);
     },
     loadElementList: function(){
-        if( MWF.AC.isAdministrator() ){
+        if( MWF.AC.isServiceManager() ){
             this._loadItemDataList(function(json){
                 if (json.data.length){
                     json.data.each(function(item){