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

LCFS-1654: Protect routes for compliance report #1686

Merged
merged 6 commits into from
Jan 17, 2025

Conversation

areyeslo
Copy link
Collaborator

If the user has Government role and the compliance report status is "Draft" restrict access to the compliance report and its schedules to ensure they remain protected. The user is returned to /compliance-reporting

/compliance-reporting/:compliancePeriod/:complianceReportId/
/compliance-reporting/:compliancePeriod/:complianceReportId/supply-of-fuel
/compliance-reporting/:compliancePeriod/:complianceReportId/final-supply-equipments
/compliance-reporting/:compliancePeriod/:complianceReportId/allocation-agreements
/compliance-reporting/:compliancePeriod/:complianceReportId/notional-transfers
/compliance-reporting/:compliancePeriod/:complianceReportId/fuels-other-use
/compliance-reporting/:compliancePeriod/:complianceReportId/fuel-exports

Story

Copy link

github-actions bot commented Jan 14, 2025

Frontend Test Results

  1 files  ±0  123 suites  ±0   44s ⏱️ -1s
429 tests ±0  409 ✅ ±0  20 💤 ±0  0 ❌ ±0 
431 runs  ±0  411 ✅ ±0  20 💤 ±0  0 ❌ ±0 

Results for commit 7b863d3. ± Comparison against base commit 42556b3.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jan 14, 2025

Backend Test Results

503 tests  ±0   503 ✅ ±0   1m 45s ⏱️ +3s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 7b863d3. ± Comparison against base commit 42556b3.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@AlexZorkin AlexZorkin left a comment

Choose a reason for hiding this comment

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

Although your solution is workable, this adds an extra api call every time we open one of these views. A more efficient solution would be to use the existing validation files on the backend and check user permissions there. validation.py already uses compliance record so we have status available. Let me know what you think.

@areyeslo areyeslo force-pushed the LCFS-1654-Protect-Routes-ComplianceReports branch from d833eae to f07e545 Compare January 16, 2025 18:05
@areyeslo areyeslo force-pushed the LCFS-1654-Protect-Routes-ComplianceReports branch from f07e545 to 30717de Compare January 16, 2025 22:58
@areyeslo areyeslo force-pushed the LCFS-1654-Protect-Routes-ComplianceReports branch from 30717de to d793d7c Compare January 16, 2025 23:09
@areyeslo areyeslo requested a review from AlexZorkin January 16, 2025 23:15
Copy link
Collaborator

@AlexZorkin AlexZorkin left a comment

Choose a reason for hiding this comment

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

Looks good. Thank you for moving to a backend solution. 👍

@areyeslo areyeslo merged commit 3af0a64 into release-0.2.0 Jan 17, 2025
11 checks passed
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