From c096a98ceb96fbc0cfebbaf9379320d79e102aac Mon Sep 17 00:00:00 2001 From: YANG QIA <2013xile@gmail.com> Date: Tue, 5 Sep 2023 12:03:42 +0800 Subject: [PATCH] fix: issue of plugin snippet (#2593) --- .../collection-manager/src/server/server.ts | 2 +- .../multi-app-manager/src/server/server.ts | 8 +---- .../plugins/theme-editor/src/server/plugin.ts | 4 +++ yarn.lock | 32 ------------------- 4 files changed, 6 insertions(+), 40 deletions(-) diff --git a/packages/plugins/collection-manager/src/server/server.ts b/packages/plugins/collection-manager/src/server/server.ts index d07e4b90b..0394930f6 100644 --- a/packages/plugins/collection-manager/src/server/server.ts +++ b/packages/plugins/collection-manager/src/server/server.ts @@ -45,7 +45,7 @@ export class CollectionManagerPlugin extends Plugin { this.app.acl.registerSnippet({ name: `pm.${this.name}.collections`, - actions: ['collections:*', 'collections.fields:*', 'dbViews:*'], + actions: ['collections:*', 'collections.fields:*', 'dbViews:*', 'collectionCategories:*'], }); this.app.db.on('collections.beforeCreate', async (model) => { diff --git a/packages/plugins/multi-app-manager/src/server/server.ts b/packages/plugins/multi-app-manager/src/server/server.ts index f0a67ad88..1319288fa 100644 --- a/packages/plugins/multi-app-manager/src/server/server.ts +++ b/packages/plugins/multi-app-manager/src/server/server.ts @@ -303,13 +303,7 @@ export class PluginMultiAppManager extends Plugin { this.app.acl.allow('applications', 'listPinned', 'loggedIn'); this.app.acl.registerSnippet({ - name: ` - pm.$; - { - this.name; - } - . - applications`, + name: `pm.${this.name}.applications`, actions: ['applications:*'], }); diff --git a/packages/plugins/theme-editor/src/server/plugin.ts b/packages/plugins/theme-editor/src/server/plugin.ts index 805cfec42..9ff0aaf5d 100644 --- a/packages/plugins/theme-editor/src/server/plugin.ts +++ b/packages/plugins/theme-editor/src/server/plugin.ts @@ -29,6 +29,10 @@ export class ThemeEditorPlugin extends Plugin { ], }); this.app.acl.allow('themeConfig', 'list', 'loggedIn'); + this.app.acl.registerSnippet({ + name: `pm.${this.name}.themeConfig`, + actions: ['themeConfig:*'], + }); } async install(options?: InstallOptions) { diff --git a/yarn.lock b/yarn.lock index 62cd67229..f70d5cc0f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -165,7 +165,6 @@ "@ant-design/cssinjs@^1.16.0": version "1.17.0" resolved "https://registry.npmmirror.com/@ant-design/cssinjs/-/cssinjs-1.17.0.tgz#a3f69cf5131539b76ccdbfced43d242557599fea" - integrity sha512-MgGCZ6sfD3yQB0XW0hN4jgixMxApTlDYyct+pc7fRZNO4CaqWWm/9iXkkljNR27lyWLZmm+XiDfcIOo1bnrnMA== dependencies: "@babel/runtime" "^7.11.1" "@emotion/hash" "^0.8.0" @@ -182,7 +181,6 @@ "@ant-design/icons-svg@^4.3.0": version "4.3.1" resolved "https://registry.npmmirror.com/@ant-design/icons-svg/-/icons-svg-4.3.1.tgz#4b2f65a17d4d32b526baa6414aca2117382bf8da" - integrity sha512-4QBZg8ccyC6LPIRii7A0bZUk3+lEDCLnhB+FVsflGdcWPPmV+j3fire4AwwoqHV/BibgvBmR9ZIo4s867smv+g== "@ant-design/icons@5.x", "@ant-design/icons@^5.0.0", "@ant-design/icons@^5.1.3", "@ant-design/icons@^5.1.4": version "5.1.4" @@ -207,7 +205,6 @@ "@ant-design/icons@^5.2.2": version "5.2.6" resolved "https://registry.npmmirror.com/@ant-design/icons/-/icons-5.2.6.tgz#2d4a9a37f531eb2a20cebec01d6fb69cf593900d" - integrity sha512-4wn0WShF43TrggskBJPRqCD0fcHbzTYjnaoskdiJrVHg86yxoZ8ZUqsXvyn4WUqehRiFKnaclOhqk9w4Ui2KVw== dependencies: "@ant-design/colors" "^7.0.0" "@ant-design/icons-svg" "^4.3.0" @@ -226,7 +223,6 @@ "@ant-design/pro-layout@^7.16.11": version "7.16.11" resolved "https://registry.npmmirror.com/@ant-design/pro-layout/-/pro-layout-7.16.11.tgz#e9bee6ea95786b98644ca271d5d97456f2f1d015" - integrity sha512-7BqsuRMavMeroWFHKHARQo46mjv9ZFdnxNREFEnoj6Zfdi+TncG5DGKUqgFR/ppliMJ7K4xEkJUlbjnP1rzmkg== dependencies: "@ant-design/icons" "^5.0.0" "@ant-design/pro-provider" "2.12.2" @@ -246,7 +242,6 @@ "@ant-design/pro-provider@2.12.2": version "2.12.2" resolved "https://registry.npmmirror.com/@ant-design/pro-provider/-/pro-provider-2.12.2.tgz#e1e07df7cdb1c5e3c277793873ab22816d5b8c3d" - integrity sha512-1ocfp56wcVKduRbDedLsBO7enEMh4i5ckq1sPCBaEb9M4vrZ2haKiYDe51qTBviUvxSCPAwNmIyluozmWnPwwg== dependencies: "@ant-design/cssinjs" "^1.11.1" "@babel/runtime" "^7.18.0" @@ -257,7 +252,6 @@ "@ant-design/pro-utils@2.14.2": version "2.14.2" resolved "https://registry.npmmirror.com/@ant-design/pro-utils/-/pro-utils-2.14.2.tgz#3b136e53f25ad7c56ccddf44a126ef1616e4f47e" - integrity sha512-srMDRis/TbNcmPVT48UlgfV5arjITHb8kt4VTgySRXrDaV3kGzJr/xcW9LcQOLTHTfY0cbdPmXS3GooBNzMZAQ== dependencies: "@ant-design/icons" "^5.0.0" "@ant-design/pro-provider" "2.12.2" @@ -2896,7 +2890,6 @@ "@floating-ui/core@^1.4.1": version "1.4.1" resolved "https://registry.npmmirror.com/@floating-ui/core/-/core-1.4.1.tgz#0d633f4b76052668afb932492ac452f7ebe97f17" - integrity sha512-jk3WqquEJRlcyu7997NtR5PibI+y5bi+LS3hPmguVClypenMsCY3CBa3LAQnozRCtCrYWSEtAdiskpamuJRFOQ== dependencies: "@floating-ui/utils" "^0.1.1" @@ -2909,7 +2902,6 @@ "@floating-ui/dom@^1.4.2": version "1.5.1" resolved "https://registry.npmmirror.com/@floating-ui/dom/-/dom-1.5.1.tgz#88b70defd002fe851f17b4a25efb2d3c04d7a8d7" - integrity sha512-KwvVcPSXg6mQygvA1TjbN/gh///36kKtllIF8SUm0qpFj8+rvYrpvlYdL1JoA71SHpDqgSSdGOSoQ0Mp3uY5aw== dependencies: "@floating-ui/core" "^1.4.1" "@floating-ui/utils" "^0.1.1" @@ -2933,7 +2925,6 @@ "@floating-ui/utils@^0.1.1": version "0.1.1" resolved "https://registry.npmmirror.com/@floating-ui/utils/-/utils-0.1.1.tgz#1a5b1959a528e374e8037c4396c3e825d6cf4a83" - integrity sha512-m0G6wlnhm/AX0H12IOWtK8gASEMffnX08RtKkCgTdHb9JpHKGloI7icFfLg9ZmQeavcvR0PKmzxClyuFPSjKWw== "@formatjs/ecma402-abstract@1.17.0": version "1.17.0" @@ -3000,7 +2991,6 @@ "@formily/antd-v5@1.1.1": version "1.1.1" resolved "https://registry.npmmirror.com/@formily/antd-v5/-/antd-v5-1.1.1.tgz#b1f103cbb99b88d14ebf66a362e6fd2177046478" - integrity sha512-fubuPHWjHVtBNWQ3iGfwy44mIRHSLn7DfvtLIYAdszHt3c4jk3ermUW2hCAeBTd9bX0NXery/VSy+yTd1Myzyg== dependencies: "@ant-design/cssinjs" "^1.3.1" "@ant-design/icons" "^5.0.0" @@ -4648,7 +4638,6 @@ "@rc-component/trigger@^1.15.0": version "1.15.6" resolved "https://registry.npmmirror.com/@rc-component/trigger/-/trigger-1.15.6.tgz#ccb71f16229e832e15b3869817cbe24f5e59b54c" - integrity sha512-Tl19KaGsShf4yzqxumsXVT4c7j0l20Dxe5hgP5S0HmxyhCg3oKen28ntGavRCIPW7cl7wgsGotntqcIokgDHzg== dependencies: "@babel/runtime" "^7.18.3" "@rc-component/portal" "^1.1.0" @@ -6758,7 +6747,6 @@ "@vitest/expect@0.34.3": version "0.34.3" resolved "https://registry.npmmirror.com/@vitest/expect/-/expect-0.34.3.tgz#576e1fd6a3a8b8b7a79a06477f3d450a77d67852" - integrity sha512-F8MTXZUYRBVsYL1uoIft1HHWhwDbSzwAU9Zgh8S6WFC3YgVb4AnFV2GXO3P5Em8FjEYaZtTnQYoNwwBrlOMXgg== dependencies: "@vitest/spy" "0.34.3" "@vitest/utils" "0.34.3" @@ -6767,7 +6755,6 @@ "@vitest/runner@0.34.3": version "0.34.3" resolved "https://registry.npmmirror.com/@vitest/runner/-/runner-0.34.3.tgz#ce09b777d133bbcf843e1a67f4a743365764e097" - integrity sha512-lYNq7N3vR57VMKMPLVvmJoiN4bqwzZ1euTW+XXYH5kzr3W/+xQG3b41xJn9ChJ3AhYOSoweu974S1V3qDcFESA== dependencies: "@vitest/utils" "0.34.3" p-limit "^4.0.0" @@ -6776,7 +6763,6 @@ "@vitest/snapshot@0.34.3": version "0.34.3" resolved "https://registry.npmmirror.com/@vitest/snapshot/-/snapshot-0.34.3.tgz#cb4767aa44711a1072bd2e06204b659275c4f0f2" - integrity sha512-QyPaE15DQwbnIBp/yNJ8lbvXTZxS00kRly0kfFgAD5EYmCbYcA+1EEyRalc93M0gosL/xHeg3lKAClIXYpmUiQ== dependencies: magic-string "^0.30.1" pathe "^1.1.1" @@ -6785,14 +6771,12 @@ "@vitest/spy@0.34.3": version "0.34.3" resolved "https://registry.npmmirror.com/@vitest/spy/-/spy-0.34.3.tgz#d4cf25e6ca9230991a0223ecd4ec2df30f0784ff" - integrity sha512-N1V0RFQ6AI7CPgzBq9kzjRdPIgThC340DGjdKdPSE8r86aUSmeliTUgkTqLSgtEwWWsGfBQ+UetZWhK0BgJmkQ== dependencies: tinyspy "^2.1.1" "@vitest/utils@0.34.3": version "0.34.3" resolved "https://registry.npmmirror.com/@vitest/utils/-/utils-0.34.3.tgz#6e243189a358b736b9fc0216e6b6979bc857e897" - integrity sha512-kiSnzLG6m/tiT0XEl4U2H8JDBjFtwVlaE8I3QfGiMFR0QvnRDfYfdP3YvTBWM/6iJDAyaPY6yVQiCTUc7ZzTHA== dependencies: diff-sequences "^29.4.3" loupe "^2.3.6" @@ -7114,7 +7098,6 @@ antd-mobile-v5-count@^1.0.1: antd-mobile@^5.29.1: version "5.32.1" resolved "https://registry.npmmirror.com/antd-mobile/-/antd-mobile-5.32.1.tgz#513211e25356015c24c6288a49baa950b8857676" - integrity sha512-COLyXa6PO0bF3ytYxp/ut87cB3b69IonHoFbQb5F48zHrppckjx47Dbn6DZ/EZdqirWDN8kBjs4CCkOeZa34LA== dependencies: "@floating-ui/dom" "^1.4.2" "@rc-component/mini-decimal" "^1.1.0" @@ -7137,7 +7120,6 @@ antd-mobile@^5.29.1: antd-style@3.4.5, antd-style@3.x: version "3.4.5" resolved "https://registry.npmmirror.com/antd-style/-/antd-style-3.4.5.tgz#ed1c81a738b3ae9c4079824b13a30c27ab934f4e" - integrity sha512-6aC4P9XyuVy0O7eZ+HZXd8GbbFX9HgzsXsJ341ihJhgqrfsQZNx8lDQvS2kCV6ao99QqtyTDphK9gWOgV2bHEw== dependencies: "@ant-design/cssinjs" "^1" "@babel/runtime" "^7" @@ -7170,7 +7152,6 @@ antd-token-previewer@2.0.0-alpha.8, antd-token-previewer@^2.0.0-alpha.6: antd@5.8.6, antd@5.x, antd@^5.4.2, antd@^5.5.1: version "5.8.6" resolved "https://registry.npmmirror.com/antd/-/antd-5.8.6.tgz#48af8d4221098dbd1faa5e56f0a1344741e2a3dc" - integrity sha512-DQdHJSq7AH303NgAUZcMRrWqwRYLT9LjesrfhB9xwwi3ooWTMAnS0LrL2NIYHvXZQy1kV0C4mMSiSbBqEKatLA== dependencies: "@ant-design/colors" "^7.0.0" "@ant-design/cssinjs" "^1.16.0" @@ -19309,7 +19290,6 @@ rc-align@^4.0.0: rc-cascader@~3.14.0: version "3.14.1" resolved "https://registry.npmmirror.com/rc-cascader/-/rc-cascader-3.14.1.tgz#495f00b8d047a54fa64df3102f4d6e4a664feaf2" - integrity sha512-fCsgjLIQqYZMhFj9UT+x2ZW4uobx7OP5yivcn6Xto5fuxHaldphsryzCeUVmreQOHEo0RP+032Ip9RDzrKVKJA== dependencies: "@babel/runtime" "^7.12.5" array-tree-filter "^2.1.0" @@ -19385,7 +19365,6 @@ rc-field-form@~1.27.4: rc-field-form@~1.36.0: version "1.36.2" resolved "https://registry.npmmirror.com/rc-field-form/-/rc-field-form-1.36.2.tgz#0a4e75ab9849e3c2517b8b07c1f97ecd3e52db55" - integrity sha512-tCF/JjUsnxW80Gk4E4ZH74ONsaQMxVTRtui6XhQB8DJc4FHWLLa5pP8zwhxtPKC5NaO0QZ0Cv79JggDubn6n2g== dependencies: "@babel/runtime" "^7.18.0" async-validator "^4.1.0" @@ -19394,7 +19373,6 @@ rc-field-form@~1.36.0: rc-image@~7.1.0: version "7.1.3" resolved "https://registry.npmmirror.com/rc-image/-/rc-image-7.1.3.tgz#0072547c7c0a70e6badfb4bee320806c5bf7427b" - integrity sha512-foMl1rcit1F0+vgxE5kf0c8TygQcHhILsOohQUL+JMUbzOo3OBFRcehJudYbqbCTArzCecS8nA1irUU9vvgQbg== dependencies: "@babel/runtime" "^7.11.2" "@rc-component/portal" "^1.0.2" @@ -19455,7 +19433,6 @@ rc-motion@^2.0.0, rc-motion@^2.0.1, rc-motion@^2.3.0, rc-motion@^2.3.4, rc-motio rc-notification@~5.1.1: version "5.1.1" resolved "https://registry.npmmirror.com/rc-notification/-/rc-notification-5.1.1.tgz#62b38890575a1726ed6c1dd0e10caf4ce45a9e69" - integrity sha512-BPnded/WmWFE57ubqhVCgRSuedfQQNeSOYqdwppyr2B/Wt909gYFKyWAkFJVXuppAjsOGop05a93UaxjmUFdkg== dependencies: "@babel/runtime" "^7.10.1" classnames "2.x" @@ -19474,7 +19451,6 @@ rc-overflow@^1.0.0, rc-overflow@^1.3.1: rc-pagination@~3.6.0: version "3.6.1" resolved "https://registry.npmmirror.com/rc-pagination/-/rc-pagination-3.6.1.tgz#2db6678a57cd2f4f29d6c0416e282543af52d0df" - integrity sha512-R/sUnKKXx1Nm4kZfUKS3YKa7yEPF1ZkVB/AynQaHt+nMER7h9wPTfliDJFdYo+RM/nk2JD4Yc5QpUq8fIQHeug== dependencies: "@babel/runtime" "^7.10.1" classnames "^2.2.1" @@ -19483,7 +19459,6 @@ rc-pagination@~3.6.0: rc-picker@~3.13.0: version "3.13.1" resolved "https://registry.npmmirror.com/rc-picker/-/rc-picker-3.13.1.tgz#06adc7b1ccbcfa05ff1ac9aae0c696fb5546f20d" - integrity sha512-211SrinX5IXZ9FMMDUMyPLuGOdfftUtd8zj4lqudpFxlMdtgV5+hXUJMBKb26xmDsleOm5iySK6KIHgiaI+U4w== dependencies: "@babel/runtime" "^7.10.1" "@rc-component/trigger" "^1.5.0" @@ -19539,7 +19514,6 @@ rc-select@~14.1.0: rc-select@~14.7.0, rc-select@~14.7.1: version "14.7.4" resolved "https://registry.npmmirror.com/rc-select/-/rc-select-14.7.4.tgz#742d85861e83604237784f60e2ba9dabcde8eac9" - integrity sha512-qRUpvMVXFy6rdHe+qzHXAqyQAfhErC/oY8dcRtoRjoz0lz2Nx3J+lLL5AnEbjnwlS+/kQTJUZ/65WyCwWwcLwQ== dependencies: "@babel/runtime" "^7.10.1" "@rc-component/trigger" "^1.5.0" @@ -19552,7 +19526,6 @@ rc-select@~14.7.0, rc-select@~14.7.1: rc-slider@~10.2.1: version "10.2.1" resolved "https://registry.npmmirror.com/rc-slider/-/rc-slider-10.2.1.tgz#9b571d19f740adcacdde271f44901a47717fd8da" - integrity sha512-l355C/65iV4UFp7mXq5xBTNX2/tF2g74VWiTVlTpNp+6vjE/xaHHNiQq5Af+Uu28uUiqCuH/QXs5HfADL9KJ/A== dependencies: "@babel/runtime" "^7.10.1" classnames "^2.2.5" @@ -19627,7 +19600,6 @@ rc-tree-select@5.5.5: rc-tree-select@~5.11.0: version "5.11.2" resolved "https://registry.npmmirror.com/rc-tree-select/-/rc-tree-select-5.11.2.tgz#66b4a95843c6c1e04ba923a485e8b13def3ad6d0" - integrity sha512-ujRFO3pcjSg8R4ndXX2oiNcCu+RgO9ZPcd23CZy18Khm+nRsfWWS3Su7qB0iuoJgzAJ5LK7b6Dio0t7IQDGs9g== dependencies: "@babel/runtime" "^7.10.1" classnames "2.x" @@ -19690,7 +19662,6 @@ rc-util@^5.35.0: rc-util@^5.37.0: version "5.37.0" resolved "https://registry.npmmirror.com/rc-util/-/rc-util-5.37.0.tgz#6df9a55cb469b41b6995530a45b5f3dd3219a4ea" - integrity sha512-cPMV8DzaHI1KDaS7XPRXAf4J7mtBqjvjikLpQieaeOO7+cEbqY2j7Kso/T0R0OiEZTNcLS/8Zl9YrlXiO9UbjQ== dependencies: "@babel/runtime" "^7.18.3" react-is "^16.12.0" @@ -22191,7 +22162,6 @@ tinycolor2@^1.6.0: tinypool@^0.7.0: version "0.7.0" resolved "https://registry.npmmirror.com/tinypool/-/tinypool-0.7.0.tgz#88053cc99b4a594382af23190c609d93fddf8021" - integrity sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww== tinyspy@^2.1.1: version "2.1.1" @@ -23249,7 +23219,6 @@ vinyl@^2.0.0, vinyl@^2.2.0: vite-node@0.34.3: version "0.34.3" resolved "https://registry.npmmirror.com/vite-node/-/vite-node-0.34.3.tgz#de134fe38bc1555ac8ab5e489d7df6159a3e1a4c" - integrity sha512-+0TzJf1g0tYXj6tR2vEyiA42OPq68QkRZCu/ERSo2PtsDJfBpDyEfuKbRvLmZqi/CgC7SCBtyC+WjTGNMRIaig== dependencies: cac "^6.7.14" debug "^4.3.4" @@ -23302,7 +23271,6 @@ vite@^4.4.1: vitest@0.x, vitest@^0.34.3: version "0.34.3" resolved "https://registry.npmmirror.com/vitest/-/vitest-0.34.3.tgz#863d61c133d01b16e49fd52d380c09fa5ac03188" - integrity sha512-7+VA5Iw4S3USYk+qwPxHl8plCMhA5rtfwMjgoQXMT7rO5ldWcdsdo3U1QD289JgglGK4WeOzgoLTsGFu6VISyQ== dependencies: "@types/chai" "^4.3.5" "@types/chai-subset" "^1.3.3"