mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
fix SystemController config read permission
This commit is contained in:
@@ -125,7 +125,7 @@ export class SystemController extends Controller {
|
|||||||
private registerConfigController(client: Hono<any>): void {
|
private registerConfigController(client: Hono<any>): void {
|
||||||
const { permission } = this.middlewares;
|
const { permission } = this.middlewares;
|
||||||
// don't add auth again, it's already added in getController
|
// don't add auth again, it's already added in getController
|
||||||
const hono = this.create(); /* .use(permission(SystemPermissions.configRead)); */
|
const hono = this.create();
|
||||||
|
|
||||||
if (!this.app.isReadOnly()) {
|
if (!this.app.isReadOnly()) {
|
||||||
const manager = this.app.modules as DbModuleManager;
|
const manager = this.app.modules as DbModuleManager;
|
||||||
@@ -317,6 +317,11 @@ export class SystemController extends Controller {
|
|||||||
summary: "Get the config for a module",
|
summary: "Get the config for a module",
|
||||||
tags: ["system"],
|
tags: ["system"],
|
||||||
}),
|
}),
|
||||||
|
permission(SystemPermissions.configRead, {
|
||||||
|
context: (c) => ({
|
||||||
|
module: c.req.param("module"),
|
||||||
|
}),
|
||||||
|
}),
|
||||||
mcpTool("system_config", {
|
mcpTool("system_config", {
|
||||||
annotations: {
|
annotations: {
|
||||||
readOnlyHint: true,
|
readOnlyHint: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user