nextjs-cms-kit 0.5.68 → 0.5.69
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix-master-admin.d.ts","sourceRoot":"","sources":["../../src/lib/fix-master-admin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fix-master-admin.d.ts","sourceRoot":"","sources":["../../src/lib/fix-master-admin.ts"],"names":[],"mappings":"AAEA,wBAAsB,wBAAwB,kBAoD7C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getPluginRoutes } from 'nextjs-cms/plugins/server';
|
|
1
2
|
export async function fixMasterAdminPrivileges() {
|
|
2
3
|
// Lazy import heavy dependencies to avoid eager database connection initialization
|
|
3
4
|
const { SectionFactory } = await import('nextjs-cms/core/factories');
|
|
@@ -12,8 +13,20 @@ export async function fixMasterAdminPrivileges() {
|
|
|
12
13
|
operations: 'CUD',
|
|
13
14
|
publisher: '1',
|
|
14
15
|
}));
|
|
16
|
+
const pluginRoutes = await getPluginRoutes();
|
|
17
|
+
const pluginNames = new Set(pluginRoutes.map((route) => {
|
|
18
|
+
return route.pluginName;
|
|
19
|
+
}));
|
|
20
|
+
pluginNames.forEach((pluginName) => {
|
|
21
|
+
rows.push({
|
|
22
|
+
adminId: '1',
|
|
23
|
+
sectionName: pluginName,
|
|
24
|
+
operations: 'CUD',
|
|
25
|
+
publisher: '1',
|
|
26
|
+
});
|
|
27
|
+
});
|
|
15
28
|
/**
|
|
16
|
-
* Add the admins
|
|
29
|
+
* Add the admins section to the privileges
|
|
17
30
|
*/
|
|
18
31
|
rows.push({
|
|
19
32
|
adminId: '1',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nextjs-cms-kit",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.69",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"nextjs-cms-kit": "./dist/index.js"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"gradient-string": "^3.0.0",
|
|
34
34
|
"mysql2": "^3.12.0",
|
|
35
35
|
"ora": "9.0.0",
|
|
36
|
-
"nextjs-cms": "0.5.
|
|
36
|
+
"nextjs-cms": "0.5.69"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/bcrypt": "^6.0.0",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"tsx": "^4.20.6",
|
|
44
44
|
"typescript": "^5.9.2",
|
|
45
45
|
"@lzcms/eslint-config": "0.3.0",
|
|
46
|
-
"@lzcms/
|
|
47
|
-
"@lzcms/
|
|
46
|
+
"@lzcms/prettier-config": "0.1.0",
|
|
47
|
+
"@lzcms/tsconfig": "0.1.0"
|
|
48
48
|
},
|
|
49
49
|
"prettier": "@lzcms/prettier-config",
|
|
50
50
|
"scripts": {
|