fix(manager-api): require msorder_save for order write routes#402
Open
Ibochkarev wants to merge 2 commits into
Open
fix(manager-api): require msorder_save for order write routes#402Ibochkarev wants to merge 2 commits into
Ibochkarev wants to merge 2 commits into
Conversation
Split /api/mgr/orders into read (msorder_list) and write (msorder_save) groups so list-only manager roles cannot mutate orders via the API.
Extend the #377 regression test to dispatch sample routes with a stub modX so list-only write and save-only read return 403 before handlers.
Member
Author
Follow-up по silent-failure reviewЗакрыто в PR:
Оставлено follow-up (вне #377):
|
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.
Описание
Группа
/api/mgr/orders/*целиком висела наmsorder_list, поэтому роль только со списком могла менять и удалять заказы через Manager API.Разделил маршруты на две группы:
msorder_listmsorder_savePermissionMiddlewareпо-прежнему отдаёт 403 до контроллера. РодительскийAuthMiddleware(mgr)не менялся.Тип изменений
Связанные Issues
Closes #377
Как это было протестировано?
Gate E (exit codes):
php -l core/components/minishop3/config/routes/manager.php→ 0php -l core/components/minishop3/tests/OrdersRoutePermissionsTest.php→ 0php core/components/minishop3/tests/OrdersRoutePermissionsTest.php→ 0 (OK)origin/betaтот же тест падает (POST …→msorder_list); после фикса → 0php core/components/minishop3/tests/DirectFilterKeysTest.php→ 0Конфигурация тестирования:
fix/issue-377-orders-msorder-saveСкриншоты (если применимо)
Чеклист
Дополнительные заметки
msorder_save(как в AC issue). Отдельныйmsorder_remove— follow-up.