Skip to content

VCST-3912: Add extension points for hiding prices#472

Open
artem-dudarev wants to merge 8 commits into
devfrom
VCST-3912-hide-prices
Open

VCST-3912: Add extension points for hiding prices#472
artem-dudarev wants to merge 8 commits into
devfrom
VCST-3912-hide-prices

Conversation

@artem-dudarev
Copy link
Copy Markdown
Collaborator

@artem-dudarev artem-dudarev commented Oct 29, 2025

Description

image

References

QA-test:

Jira-link:

https://virtocommerce.atlassian.net/browse/VCST-3912

Artifact URL:

https://vc3prerelease.blob.core.windows.net/packages/VirtoCommerce.Orders_3.1005.0-pr-472-c360.zip


Note

Medium Risk
Introduces a new cross-cutting data-protection layer that conditionally strips/restores pricing fields based on user permissions, affecting multiple API, export/import, and UI paths; mistakes could leak or incorrectly zero-out price data.

Overview
Adds ICustomerOrderDataProtectionService and a default CustomerOrderDataProtectionService that enforces price visibility by reducing order/payment/shipment/line-item price fields for users without ReadPrices, and restoring original prices on save.

Wires this service through Orders API search/get/save endpoints and export/import, replaces the previous web authorization handler implementation with a shared OrdersModule.Data.Authorization.OrderAuthorizationHandler/OrderAuthorizationContext, and updates UI price rendering to rely on a new withPrices flag returned per operation instead of checking permissions client-side.

Adds a core FillChildOperations() extension (deprecating FillAllChildOperations), updates clone/reduce/restore logic across order models, and includes a sample module override demonstrating store-based price permissions plus a regression test for cloning/child operation linkage.

Reviewed by Cursor Bugbot for commit c360f0b. Bugbot is set up for automated code reviews on this repo. Configure here.

cursor[bot]

This comment was marked as outdated.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@vc-ci vc-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test Suite: Test Suites/Modules/module_Assets
Tests: 13
Failures: 0
Errors: 0
Time: 7.617
Timestamp: 30-10-2025T08:29:08

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 601d142. Configure here.

Comment thread src/VirtoCommerce.OrdersModule.Web/Scripts/blades/customerOrder-list.tpl.html Outdated
Comment thread src/VirtoCommerce.OrdersModule.Web/Module.cs Outdated
searchCriteria.Skip = skip;
searchCriteria.WithPrototypes = true;
var searchResult = await _customerOrderSearchService.SearchAsync(searchCriteria);
var searchResult = await _customerOrderDataProtectionService.SearchAsync(searchCriteria);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Export strips prices when no user context exists

High Severity

The export now uses CustomerOrderDataProtectionService.SearchAsync which strips all price data when GetCurrentUser() returns null (i.e., CanReadPrices returns false for null users). In background or non-HTTP contexts the user resolver may yield null, causing a complete loss of price information in exported data. The previous implementation used the raw search service without any price filtering.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 601d142. Configure here.

@vc-ci
Copy link
Copy Markdown
Contributor

vc-ci commented Apr 9, 2026

🧪 Katalon Test Report — ✅ PASSED

🔢 Total ✅ Passed ❌ Failed
13 13 0
📋 Suite details
Suite Test Suites/Modules/module_Assets
Failures 0
Errors 0
Timestamp 09-04-2026T14:57:17

🔗 View run · Commit: 94b7dbb

@artem-dudarev artem-dudarev requested a review from OlegoO April 9, 2026 13:53
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 9, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants