w-web-perm 1.0.48 → 1.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci-test.yml +2 -2
- package/_gh-pages-deploy/.nojekyll +0 -0
- package/_gh-pages-deploy/WWebPerm.html +938 -0
- package/_gh-pages-deploy/WWebPerm.mjs.html +1228 -0
- package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/_gh-pages-deploy/index.html +84 -0
- package/_gh-pages-deploy/scripts/collapse.js +39 -0
- package/_gh-pages-deploy/scripts/commonNav.js +28 -0
- package/_gh-pages-deploy/scripts/linenumber.js +25 -0
- package/_gh-pages-deploy/scripts/nav.js +12 -0
- package/_gh-pages-deploy/scripts/polyfill.js +4 -0
- package/_gh-pages-deploy/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/_gh-pages-deploy/scripts/prettify/lang-css.js +2 -0
- package/_gh-pages-deploy/scripts/prettify/prettify.js +28 -0
- package/_gh-pages-deploy/scripts/search.js +99 -0
- package/_gh-pages-deploy/styles/jsdoc.css +776 -0
- package/_gh-pages-deploy/styles/prettify.css +80 -0
- package/dist/css/app.d8b16216.css +1 -0
- package/dist/css/{chunk-vendors.f149e124.css → chunk-vendors.2d3ef2ba.css} +1 -1
- package/dist/index.tmp +2 -2
- package/dist/js/app-legacy.fb48310a.js +1 -0
- package/dist/js/app.fb48310a.js +1 -0
- package/dist/js/chunk-vendors-legacy.8fdd4435.js +21 -0
- package/dist/js/chunk-vendors.8fdd4435.js +21 -0
- package/dist/w-web-perm.umd.js +2 -2
- package/dist/w-web-perm.umd.js.map +1 -1
- package/docs/WWebPerm.html +2 -2
- package/docs/WWebPerm.mjs.html +138 -199
- package/docs/index.html +1 -1
- package/package.json +15 -11
- package/public/index.html +2 -2
- package/server/WWebPerm.mjs +137 -198
- package/server/procCore.mjs +169 -0
- package/server/procLang.mjs +197 -0
- package/server/procStaInfor.mjs +118 -0
- package/server/provideTabs.mjs +1 -1
- package/server/srLog.mjs +30 -0
- package/server/staLogs/staEvent.callWorker.mjs +46 -0
- package/server/staLogs/staEvent.mjs +116 -0
- package/server/staLogs/staEvent.shellWorker.mjs +19 -0
- package/server/staLogs/staEventTable.mjs +100 -0
- package/server/staLogs/test_staEvent.mjs +22 -0
- package/settings.json +40 -0
- package/src/components/Common/CheckYes.vue +18 -1
- package/src/components/Layout.vue +1 -1
- package/src/components/LayoutContent.vue +13 -1
- package/src/components/LayoutContentGrups.vue +32 -23
- package/src/components/LayoutContentPemis.vue +32 -23
- package/src/components/LayoutContentStaInfor.vue +536 -0
- package/src/components/LayoutContentTargets.vue +32 -23
- package/src/components/LayoutContentUsers.vue +32 -23
- package/src/components/LayoutState.vue +5 -0
- package/src/components/VeCgrups.vue +12 -3
- package/src/components/VeCpemis.vue +12 -3
- package/src/components/VeCrules.vue +12 -3
- package/src/components/VeGrupBlngUsers.vue +18 -6
- package/src/components/VePemiBlngGrups.vue +18 -6
- package/src/getPerm.mjs +7 -17
- package/src/getPermUserInfor.mjs +8 -18
- package/src/main.js +1 -0
- package/src/plugins/mShare.mjs +8 -13
- package/src/plugins/mUI.mjs +11 -0
- package/srv.mjs +76 -101
- package/tableTags.json +1 -1
- package/db/wperm/grups/data.mdb +0 -0
- package/db/wperm/grups/lock.mdb +0 -0
- package/db/wperm/pemis/data.mdb +0 -0
- package/db/wperm/pemis/lock.mdb +0 -0
- package/db/wperm/targets/data.mdb +0 -0
- package/db/wperm/targets/lock.mdb +0 -0
- package/db/wperm/users/data.mdb +0 -0
- package/db/wperm/users/lock.mdb +0 -0
- package/dist/css/app.30e81bfe.css +0 -1
- package/dist/js/app-legacy.3324392e.js +0 -1
- package/dist/js/app.3324392e.js +0 -1
- package/dist/js/chunk-vendors-legacy.e8703728.js +0 -21
- package/dist/js/chunk-vendors.e8703728.js +0 -21
- package/test/getUserRules.test.mjs +0 -899
package/srv.mjs
CHANGED
|
@@ -1,101 +1,76 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return {}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
let verifyClientUser = (user, from) => {
|
|
81
|
-
// console.log('verifyClientUser/user', user)
|
|
82
|
-
// console.log('於生產環境時得加入限制瀏覽器使用者身份機制')
|
|
83
|
-
// return false //測試無法登入
|
|
84
|
-
return user.isAdmin === 'y' //測試僅系統管理者使用
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
let verifyAppUser = (user, from) => {
|
|
88
|
-
// console.log('verifyAppUser/user', user)
|
|
89
|
-
// console.log('於生產環境時得加入限制應用程式使用者身份機制')
|
|
90
|
-
// return false //測試無法登入
|
|
91
|
-
return user.isAdmin === 'y' //測試僅系統管理者使用
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
//WWebPerm
|
|
95
|
-
let instWWebPerm = WWebPerm(WOrm, url, db, getUserByToken, verifyClientUser, verifyAppUser, opt)
|
|
96
|
-
|
|
97
|
-
instWWebPerm.on('error', (err) => {
|
|
98
|
-
console.log(err)
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
//node srv.mjs
|
|
1
|
+
import fs from 'fs'
|
|
2
|
+
import JSON5 from 'json5'
|
|
3
|
+
import WOrm from 'w-orm-lmdb/src/WOrmLmdb.mjs'
|
|
4
|
+
import WWebPerm from './server/WWebPerm.mjs'
|
|
5
|
+
import getSettings from './g.getSettings.mjs'
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
//st(DB 設定)
|
|
9
|
+
let st = getSettings()
|
|
10
|
+
|
|
11
|
+
let url = st.dbUrl
|
|
12
|
+
let db = st.dbName
|
|
13
|
+
|
|
14
|
+
//app 設定來源: argv[2] 指定之 settings 檔(供 e2e restartBackend 注入不同語系等), 預設 ./settings.json.(對齊 SSO srv.mjs)
|
|
15
|
+
//JSON5 格式(無引號鍵 / 單引號 / 註解 / 尾逗號); language / webName / modeEdit* / webLogo 等資料設定皆在此檔.
|
|
16
|
+
let pathSettings = process.argv[2] || './settings.json'
|
|
17
|
+
let appSt = JSON5.parse(fs.readFileSync(pathSettings, 'utf8'))
|
|
18
|
+
|
|
19
|
+
let opt = {
|
|
20
|
+
|
|
21
|
+
useCheckUser: false,
|
|
22
|
+
getUserById: null,
|
|
23
|
+
useExcludeWhenNotAdmin: false,
|
|
24
|
+
|
|
25
|
+
//serverPort / subfolder / urlRedirect / showLanguage / language / showModeEdit* / modeEdit* / webName / webDescription / webLogo / kpLangExt 皆由 settings.json 提供
|
|
26
|
+
...appSt,
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
let getUserByToken = async (token) => {
|
|
31
|
+
// console.log('getUserByToken/token', token)
|
|
32
|
+
// console.log('於生產環境時得加入SSO等驗證token機制')
|
|
33
|
+
// return {} //測試無法登入
|
|
34
|
+
if (token === '{token-for-application}') { //提供外部應用系統作為存取使用者
|
|
35
|
+
return {
|
|
36
|
+
id: 'id-for-application',
|
|
37
|
+
name: 'application',
|
|
38
|
+
email: 'application@example.com',
|
|
39
|
+
isAdmin: 'y',
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (token === 'sys') { //開發階段w-ui-loginout自動給予browser使用者(且位於localhost)的token為sys
|
|
43
|
+
return {
|
|
44
|
+
id: 'id-for-admin',
|
|
45
|
+
name: 'admin',
|
|
46
|
+
email: 'admin@example.com', //mappingBy為email, 開發階段時會使用email找到所建置之使用者資料
|
|
47
|
+
isAdmin: 'y',
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
console.log('invalid token', token)
|
|
51
|
+
return {}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
let verifyClientUser = (user, from) => {
|
|
55
|
+
// console.log('verifyClientUser/user', user)
|
|
56
|
+
// console.log('於生產環境時得加入限制瀏覽器使用者身份機制')
|
|
57
|
+
// return false //測試無法登入
|
|
58
|
+
return user.isAdmin === 'y' //測試僅系統管理者使用
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
let verifyAppUser = (user, from) => {
|
|
62
|
+
// console.log('verifyAppUser/user', user)
|
|
63
|
+
// console.log('於生產環境時得加入限制應用程式使用者身份機制')
|
|
64
|
+
// return false //測試無法登入
|
|
65
|
+
return user.isAdmin === 'y' //測試僅系統管理者使用
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
//WWebPerm
|
|
69
|
+
let instWWebPerm = WWebPerm(WOrm, url, db, getUserByToken, verifyClientUser, verifyAppUser, opt)
|
|
70
|
+
|
|
71
|
+
instWWebPerm.on('error', (err) => {
|
|
72
|
+
console.log(err)
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
//node srv.mjs
|
|
76
|
+
//node srv.mjs <pathSettings> //指定 settings 檔(e2e 注入語系用)
|
package/tableTags.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"grups":"2026-
|
|
1
|
+
{"grups":"2026-06-22T14:53:50+08:00|dxIazx","pemis":"2026-06-22T14:53:50+08:00|kg4x7v","targets":"2026-06-22T14:53:50+08:00|jNJCZK","users":"2026-06-22T14:53:50+08:00|zponD1"}
|
package/db/wperm/grups/data.mdb
DELETED
|
Binary file
|
package/db/wperm/grups/lock.mdb
DELETED
|
Binary file
|
package/db/wperm/pemis/data.mdb
DELETED
|
Binary file
|
package/db/wperm/pemis/lock.mdb
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/db/wperm/users/data.mdb
DELETED
|
Binary file
|
package/db/wperm/users/lock.mdb
DELETED
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
body,html{font-family:微軟正黑體,Microsoft JhengHei,MicrosoftJhengHeiRegular,Avenir,Helvetica,Arial,sans-serif;overflow-y:hidden}a,button,div,input,p,pre,span,textarea{font-family:inherit}.fade-enter-active{-webkit-animation:go 1s;animation:go 1s}.fade-leave-active{-webkit-animation:back 1s;animation:back 1s}@-webkit-keyframes go{0%{opacity:0}to{opacity:1}}@keyframes go{0%{opacity:0}to{opacity:1}}@-webkit-keyframes back{0%{opacity:1}to{opacity:0}}@keyframes back{0%{opacity:1}to{opacity:0}}
|