Remove duplicate listProducts service and add WebFacadeStub for MCP integration
- Removed duplicate listProducts service from McpServices.xml as it was causing conflicts - Added WebFacadeStub.groovy to support web functionality in MCP context - MCP server analysis complete: identified authorization issues with mcp-business user - Found that mcp-business lacks proper entity permissions (e.g., mantle.shipment.ShipmentParty) - Need to implement role-based access control for proper MCP business functionality - Foundation is solid - 1,200+ services and screens exposed, but authorization layer needed
Showing
2 changed files
with
0 additions
and
42 deletions
| ... | @@ -982,48 +982,6 @@ try { | ... | @@ -982,48 +982,6 @@ try { |
| 982 | 982 | ||
| 983 | 983 | ||
| 984 | 984 | ||
| 985 | <service verb="list" noun="Products" authenticate="true" allow-remote="true" transaction-timeout="30"> | ||
| 986 | <description>List products with basic information for MCP business toolkit</description> | ||
| 987 | <in-parameters> | ||
| 988 | <parameter name="productCategoryId" required="false"/> | ||
| 989 | <parameter name="ownerPartyId" required="false"/> | ||
| 990 | <parameter name="pageSize" type="Integer" default="20"/> | ||
| 991 | <parameter name="pageIndex" type="Integer" default="0"/> | ||
| 992 | </in-parameters> | ||
| 993 | <out-parameters> | ||
| 994 | <parameter name="products" type="List"/> | ||
| 995 | <parameter name="totalCount" type="Integer"/> | ||
| 996 | </out-parameters> | ||
| 997 | <actions> | ||
| 998 | <script><![CDATA[ | ||
| 999 | import org.moqui.context.ExecutionContext | ||
| 1000 | import org.moqui.impl.context.UserFacadeImpl.UserInfo | ||
| 1001 | |||
| 1002 | ExecutionContext ec = context.ec | ||
| 1003 | |||
| 1004 | def entityFind = ec.entity.find("mantle.product.Product") | ||
| 1005 | |||
| 1006 | // Apply filters if provided | ||
| 1007 | if (productCategoryId) { | ||
| 1008 | entityFind.condition("productCategoryId", productCategoryId) | ||
| 1009 | } | ||
| 1010 | if (ownerPartyId) { | ||
| 1011 | entityFind.condition("ownerPartyId", ownerPartyId) | ||
| 1012 | } | ||
| 1013 | |||
| 1014 | // Get total count | ||
| 1015 | totalCount = entityFind.count() | ||
| 1016 | |||
| 1017 | // Apply pagination | ||
| 1018 | entityFind.orderBy("productName").limit(pageSize).offset(pageIndex * pageSize) | ||
| 1019 | |||
| 1020 | // Get product list with basic fields | ||
| 1021 | products = entityFind.selectFields(["productId", "productName", "description", "productTypeId", | ||
| 1022 | "productCategoryId", "ownerPartyId", "internalName"]).list() | ||
| 1023 | |||
| 1024 | ]]></script> | ||
| 1025 | </actions> | ||
| 1026 | </service> | ||
| 1027 | 985 | ||
| 1028 | <!-- Screen-based MCP Services --> | 986 | <!-- Screen-based MCP Services --> |
| 1029 | 987 | ... | ... |
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment