fix(product-data): category scope для inline-edit PUT - #454
Merged
Conversation
5 tasks
Ibochkarev
force-pushed
the
fix/issue-444-product-data-category-scope
branch
3 times, most recently
from
July 29, 2026 02:05
51efcda to
bc21cd5
Compare
12 tasks
When category_id is sent with product-data updates, verify the product belongs to the same parent/nested scope as the category products grid. Closes #444.
Ibochkarev
force-pushed
the
fix/issue-444-product-data-category-scope
branch
from
July 29, 2026 11:37
bc21cd5 to
32ba6fd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Описание
Закрывает #444: inline-edit в гриде «Товары категории» шлёт
PUT /api/mgr/product-data/{id}без привязки к категории — можно было менять данные чужого товара по id.Threat model: при наличии
category_idв теле запроса backend проверяет, чтоmsProduct.parentвходит в тот же scope, что и list-фильтр грида (parent = categoryIdили nested descendants). Поляcategory_id/nestedвырезаются доupdateProductData(). Безcategory_idповедение прежнее — нужно для вкладкиProductDataFields(редактирование карточки товара вне контекста категории).Vue-грид теперь всегда передаёт
category_id+nestedпри inline-save.Тип изменений
Связанные Issues
Closes #444
Как это было протестировано?
Ручной сценарий:
PUT /product-data/{foreignId}сcategory_id=A,nested=0для товара из другой категории — 403 + lexiconms3_err_product_not_in_category_scope.PUT /product-data/{id}безcategory_idиз вкладки ProductData — без изменений (global save).Gate A
getAllowedProductParentCategoryIds+isProductInCategoryScopeCategoryProductScopePolicyTestProductDataController::updateuseCategoryProductsInlineEditЧеклист
ms3_err_product_not_in_category_scope)Дополнительные заметки
Out of scope (отдельный issue): полное закрытие unscoped
PUT /product-data/{id}— сломаетProductDataFields.vue. Category-scoped route (/categories/{id}/products/{productId}/data) — возможный follow-up.Refs #418 — bulk mutations category products пока без scope-check в
CategoryProductsController::multiple()(не входит в #444).