Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cms] Filter invoices by line item domain #1351

Merged
merged 1 commit into from May 21, 2021

Conversation

alexlyp
Copy link
Member

@alexlyp alexlyp commented Dec 18, 2020

Close #1346

This changes the current way users are able to view others' invoices. Previously non-admin users were allowed to view all invoices submitted by others within their domain. Now users are able to see line items that match their domain. The rest of the line items that don't match domain and other private information are filtered out.

var cmsDomain cms.AvailableDomain
for _, domain := range cms.PolicySupportedCMSDomains {
if int(domain.Type) == requestedDomain {
cmsDomain = domain
Copy link

Choose a reason for hiding this comment

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

I guess PolicySupportedCMSDomains should never return two domains with the same type, but for extra safety this for loop might want a break.

Copy link
Member

@lukebp lukebp left a comment

Choose a reason for hiding this comment

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

ACK

@alexlyp alexlyp merged commit 08d6c45 into decred:master May 21, 2021
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.

[cms] Peer review line items based on their domain, not account domain
3 participants