-
Notifications
You must be signed in to change notification settings - Fork 61
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
chore(j-s): Allow public prosecutor user to open case files #15852
Conversation
WalkthroughThe changes involve the addition of the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Datadog ReportBranch report: ✅ 0 Failed, 20102 Passed, 0 Skipped, 17m 56.33s Total Time |
…-is/island.is into j-s/rsak-user-file-access
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15852 +/- ##
==========================================
+ Coverage 36.85% 36.95% +0.09%
==========================================
Files 6684 6680 -4
Lines 136781 136383 -398
Branches 38885 38716 -169
==========================================
- Hits 50415 50403 -12
+ Misses 86366 85980 -386
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 25 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but consider adding access to other generated files for indictments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (7)
- apps/judicial-system/backend/src/app/modules/case/case.controller.ts (2 hunks)
- apps/judicial-system/backend/src/app/modules/case/test/caseController/getCaseFilesRecordPdfRolesRules.spec.ts (2 hunks)
- apps/judicial-system/backend/src/app/modules/case/test/caseController/getIndictmentPdfRolesRules.spec.ts (2 hunks)
- apps/judicial-system/backend/src/app/modules/file/file.controller.ts (2 hunks)
- apps/judicial-system/backend/src/app/modules/file/guards/test/viewCaseFileGuard.spec.ts (2 hunks)
- apps/judicial-system/backend/src/app/modules/file/guards/viewCaseFile.guard.ts (2 hunks)
- apps/judicial-system/backend/src/app/modules/file/test/fileController/getCaseFileSignedUrlRolesRules.spec.ts (2 hunks)
Additional context used
Path-based instructions (7)
apps/judicial-system/backend/src/app/modules/case/test/caseController/getIndictmentPdfRolesRules.spec.ts (1)
Pattern
apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
apps/judicial-system/backend/src/app/modules/case/test/caseController/getCaseFilesRecordPdfRolesRules.spec.ts (1)
Pattern
apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
apps/judicial-system/backend/src/app/modules/file/test/fileController/getCaseFileSignedUrlRolesRules.spec.ts (1)
Pattern
apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
apps/judicial-system/backend/src/app/modules/file/guards/viewCaseFile.guard.ts (1)
Pattern
apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
apps/judicial-system/backend/src/app/modules/file/file.controller.ts (1)
Pattern
apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
apps/judicial-system/backend/src/app/modules/file/guards/test/viewCaseFileGuard.spec.ts (1)
Pattern
apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
apps/judicial-system/backend/src/app/modules/case/case.controller.ts (1)
Pattern
apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
Biome
apps/judicial-system/backend/src/app/modules/file/guards/test/viewCaseFileGuard.spec.ts
[error] 218-231: Disallow duplicate setup and teardown hooks.
Disallow beforeEach duplicacy inside the describe function.
(lint/suspicious/noDuplicateTestHooks)
[error] 245-258: Disallow duplicate setup and teardown hooks.
Disallow beforeEach duplicacy inside the describe function.
(lint/suspicious/noDuplicateTestHooks)
Additional comments not posted (12)
apps/judicial-system/backend/src/app/modules/case/test/caseController/getIndictmentPdfRolesRules.spec.ts (2)
7-7
: LGTM!The code changes are approved.
23-23
: LGTM!The code changes are approved.
Also applies to: 26-26
apps/judicial-system/backend/src/app/modules/case/test/caseController/getCaseFilesRecordPdfRolesRules.spec.ts (2)
7-7
: LGTM!The addition of the
publicProsecutorStaffRule
to the imported rules is consistent with the PR objective of allowing public prosecutor staff to access case files.
23-23
: LGTM!The updated test case correctly validates the presence of the
publicProsecutorStaffRule
in therules
array for thegetCaseFilesRecordPdf
method of theCaseController
.Also applies to: 26-26
apps/judicial-system/backend/src/app/modules/file/test/fileController/getCaseFileSignedUrlRolesRules.spec.ts (2)
11-11
: LGTM!The code changes are approved.
27-30
: LGTM!The code changes are approved.
apps/judicial-system/backend/src/app/modules/file/guards/viewCaseFile.guard.ts (2)
17-17
: LGTM!The code changes are approved.
48-50
: LGTM!The code changes are approved. The new condition correctly allows public prosecutor users to access completed cases, which aligns with the PR objective.
apps/judicial-system/backend/src/app/modules/file/file.controller.ts (2)
40-40
: LGTM!The code change is approved.
137-137
: LGTM!The code change is approved for the following reasons:
- It aligns with the PR objective of allowing public prosecutor staff to access case files.
- The change is made in the appropriate method responsible for retrieving the signed URL of a case file.
- The method has the necessary guards to ensure proper access control based on user roles.
apps/judicial-system/backend/src/app/modules/case/case.controller.ts (2)
551-551
: Approved. The code change resolves the access control issue.The addition of
publicProsecutorStaffRule
to the@RolesRules
decorator allows public prosecutor staff to access thegetCaseFilesRecordPdf
endpoint, which is consistent with the requirement mentioned in the existing comment thread.
707-707
: Approved. The code change enhances access control.The addition of
publicProsecutorStaffRule
to the@RolesRules
decorator allows public prosecutor staff to access thegetIndictmentPdf
endpoint, which is consistent with the objective of enabling public prosecutor staff to access case files.
apps/judicial-system/backend/src/app/modules/file/guards/test/viewCaseFileGuard.spec.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- apps/judicial-system/backend/src/app/modules/case/case.controller.ts (2 hunks)
Files skipped from review due to trivial changes (1)
- apps/judicial-system/backend/src/app/modules/case/case.controller.ts
* chore(j-s): Allow public prosecutor user to open case files * Update getByIdRolesRules.spec.ts * Update getCaseFileSignedUrlRolesRules.spec.ts * fix(j-s): Only show public prosecutor cases in a complete state * Update getCaseFileSignedUrlRolesRules.spec.ts * fix(j-s):tests * fix(j-s): Add public prosecutor staff rule for indictment pdf --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Ríksak - skrifstofustarfsmenn geta ekki opnað nein skjöl á yfirliti máls.
What
Allow public prosecutor staff to open case files
Why
Because they should be allowed to view the case files
Checklist:
Summary by CodeRabbit
New Features
publicProsecutorStaffRule
, allowing public prosecutor staff to access case management functionalities.ViewCaseFileGuard
to permit public prosecutors to view completed cases.Bug Fixes
Tests
CaseController
andFileController
to include checks for the newpublicProsecutorStaffRule
.