mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-08-03 15:11:40 +00:00
Check user permissions for search_parts MCP tool
This commit is contained in:
parent
62f3216071
commit
3df407abfe
1 changed files with 3 additions and 1 deletions
|
|
@ -115,8 +115,9 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
title: "Search parts by keyword",
|
title: "Search parts by keyword",
|
||||||
description: 'Search for parts',
|
description: 'Search for parts',
|
||||||
annotations: ['readOnlyHint' => true, 'destructiveHint' => false, 'idempotentHint' => true, 'openWorldHint' => false],
|
annotations: ['readOnlyHint' => true, 'destructiveHint' => false, 'idempotentHint' => true, 'openWorldHint' => false],
|
||||||
|
security: 'is_granted("@parts.read")',
|
||||||
input: PartSearchFilter::class,
|
input: PartSearchFilter::class,
|
||||||
processor: SearchPartsProcessor::class,
|
processor: SearchPartsProcessor::class
|
||||||
),
|
),
|
||||||
'get_part_details' => new McpTool(
|
'get_part_details' => new McpTool(
|
||||||
title: 'Get part details by ID',
|
title: 'Get part details by ID',
|
||||||
|
|
@ -126,6 +127,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
'groups' => ['part:read', 'provider_reference:read', 'api:basic:read', 'part_lot:read', 'orderdetail:read', 'pricedetail:read', 'parameter:read', 'attachment:read', 'eda_info:read'],
|
'groups' => ['part:read', 'provider_reference:read', 'api:basic:read', 'part_lot:read', 'orderdetail:read', 'pricedetail:read', 'parameter:read', 'attachment:read', 'eda_info:read'],
|
||||||
'item_uri_template' => '/api/parts/{id}',
|
'item_uri_template' => '/api/parts/{id}',
|
||||||
],
|
],
|
||||||
|
security: 'is_granted("edit", object)',
|
||||||
input: ElementByIdInput::class,
|
input: ElementByIdInput::class,
|
||||||
validate: true,
|
validate: true,
|
||||||
processor: GetPartByIdProcessor::class
|
processor: GetPartByIdProcessor::class
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue