@oneentry/mcp-platform-server 0.1.13 → 0.1.14
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/data/permissions.json +9 -2
- package/dist/tools/api-call.js +10 -10
- package/knowledge/operating-rules.md +1 -1
- package/package.json +1 -1
package/data/permissions.json
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
"byOpId": {
|
|
5
5
|
"JournalController_list": "journal.get",
|
|
6
6
|
"JournalController_clear": "journal.delete",
|
|
7
|
-
"JournalController_clear": "journal.delete",
|
|
8
7
|
"WorkflowsController_getFlows": "workflows.get",
|
|
9
8
|
"WorkflowsController_saveFlows": "workflows.update",
|
|
10
9
|
"WorkflowsController_getNodes": "workflows.get",
|
|
@@ -12,6 +11,13 @@
|
|
|
12
11
|
"WorkflowsController_getNodeCredentials": "workflows.get",
|
|
13
12
|
"WorkflowsController_getSwaggerDocs": "workflows.get",
|
|
14
13
|
"WorkflowsController_executeToNode": "workflows.update",
|
|
14
|
+
"AdminsController_findAll": "admins.get",
|
|
15
|
+
"AdminsController_create": "admins.create",
|
|
16
|
+
"AdminsController_update": "admins.update",
|
|
17
|
+
"AdminsController_updatePermissions": "admins.updatePermissions",
|
|
18
|
+
"AdminsController_remove": "admins.delete",
|
|
19
|
+
"AdminsController_findOne": "admins.get",
|
|
20
|
+
"AdminsController_updateModulePosition": "admins.changePositions",
|
|
15
21
|
"AdminAnalyticsController_getFunnel": "analytics.read",
|
|
16
22
|
"AdminAnalyticsController_getSearchNoResults": "analytics.read",
|
|
17
23
|
"AdminAnalyticsController_getSearchTop": "analytics.read",
|
|
@@ -36,7 +42,6 @@
|
|
|
36
42
|
"AdminAttributesSetsController_getAttributeFromAttributeSet": "settings.attributesSets.get",
|
|
37
43
|
"DeveloperAttributesSetsController_findOne": "settings.attributesSets.get",
|
|
38
44
|
"AuthController_logoutAllUsers": "admins.totalLogout",
|
|
39
|
-
"AuthController_logoutAllUsers": "admins.totalLogout",
|
|
40
45
|
"AdminBlocksController_previewBlock": "blocks.preview",
|
|
41
46
|
"AdminBlocksController_getSimilarDiagnostics": "blocks.preview",
|
|
42
47
|
"AdminBlocksController_create": "blocks.create",
|
|
@@ -109,6 +114,7 @@
|
|
|
109
114
|
"AdminContentApiErrorsController_clearAll": "journal.viewContentApiErrors",
|
|
110
115
|
"AdminContentApiStatsController_getStats": "journal.viewContentApiStats",
|
|
111
116
|
"AdminJournalTrafficController_getTraffic": "journal.get",
|
|
117
|
+
"AdminJournalTrafficController_clear": "journal.delete",
|
|
112
118
|
"AdminLocalesController_create": "settings.locales.create",
|
|
113
119
|
"AdminLocalesController_setActive": "settings.locales.switching",
|
|
114
120
|
"AdminLocalesController_update": "settings.locales.update",
|
|
@@ -123,6 +129,7 @@
|
|
|
123
129
|
"AdminMenusController_create": "menu.create",
|
|
124
130
|
"AdminMenusController_update": "menu.update",
|
|
125
131
|
"AdminMenusController_updatePosition": "menu.items.changePositions",
|
|
132
|
+
"AdminMenusController_remove": "menu.delete",
|
|
126
133
|
"AdminMenusController_createCustomItem": "menu.items.add",
|
|
127
134
|
"AdminMenusController_updateCustomItem": "menu.update",
|
|
128
135
|
"AdminMenusController_removeCustomItem": "menu.items.remove",
|
package/dist/tools/api-call.js
CHANGED
|
@@ -62,6 +62,16 @@ export const registerApiCall = (server, getSession) => {
|
|
|
62
62
|
audit.record({ ...auditBase, outcome: 'denied' });
|
|
63
63
|
return errorResult(levelDenial.reason, { opId, policy: config.allow, risk: operation.risk });
|
|
64
64
|
}
|
|
65
|
+
let url;
|
|
66
|
+
try {
|
|
67
|
+
url = buildUrl(config.baseUrl, operation, args);
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
if (error instanceof RequestBuildError) {
|
|
71
|
+
return errorResult(error.message, { opId, params: operation.params });
|
|
72
|
+
}
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
65
75
|
const identity = operation.permission ? await session.identity() : undefined;
|
|
66
76
|
if (identity) {
|
|
67
77
|
Object.assign(auditBase, { adminId: identity.id });
|
|
@@ -82,16 +92,6 @@ export const registerApiCall = (server, getSession) => {
|
|
|
82
92
|
}
|
|
83
93
|
return errorResult(decision.reason, { opId, policy: config.allow, risk: operation.risk });
|
|
84
94
|
}
|
|
85
|
-
let url;
|
|
86
|
-
try {
|
|
87
|
-
url = buildUrl(config.baseUrl, operation, args);
|
|
88
|
-
}
|
|
89
|
-
catch (error) {
|
|
90
|
-
if (error instanceof RequestBuildError) {
|
|
91
|
-
return errorResult(error.message, { opId, params: operation.params });
|
|
92
|
-
}
|
|
93
|
-
throw error;
|
|
94
|
-
}
|
|
95
95
|
if (decision.kind === 'needsConfirm') {
|
|
96
96
|
const token = session.confirms.issue(opId, args);
|
|
97
97
|
const target = await session.describeTarget(operation, args);
|
|
@@ -87,7 +87,7 @@ Mutations on the instance's own configuration — admins, modules, backups, sett
|
|
|
87
87
|
|
|
88
88
|
## Permissions are checked before the request is sent
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
Most operations declare the permission they need, and this server refuses locally when the admin lacks it. Some declare none, and there the `403` comes from the instance. **Ask for the grant**; retrying cannot work.
|
|
91
91
|
|
|
92
92
|
→ `mcp/docs/api/admins-and-permissions`
|
|
93
93
|
|
package/package.json
CHANGED