박정하 박정하 01-03
250103 박정하 권한 검증 용 공통 함수 추가
@e0823d180ba369fa5d0783f6ce84eadad8b21edb
client/views/common/commonPlugin.js
--- client/views/common/commonPlugin.js
+++ client/views/common/commonPlugin.js
@@ -22,6 +22,7 @@
 import { mdiMagnify, mdiFolder, mdiFolderOpen, mdiTable, mdiPlay, mdiKeyVariant, mdiTrashCan } from '@mdi/js';
 import moment from 'moment';
 import Vue from "vue";
+import store from "../pages/AppStore";
 
 export default {
   install(Vue) {
@@ -368,5 +369,22 @@
     Vue.config.globalProperties.$getFullFileTime = function (date) {
       return moment(date).format('YYMMDD_HHmmss');
     }
+
+    Vue.config.globalProperties.$authorChk = function () {
+      const authList = store.state.loginUser.user_auth;
+      for (let auth of authList) {
+        if (auth == "ROLE_ADMIN") {
+          return "ROLE_ADMIN";
+        }
+      }
+
+      for (let auth of authList) {
+        if (auth == "ROLE_VIEWER") {
+          return "ROLE_VIEWER";
+        }
+      }
+
+      return "ROLE_USER";
+    }
   }
 }
(파일 끝에 줄바꿈 문자 없음)
Add a comment
List