-
Notifications
You must be signed in to change notification settings - Fork 2.3k
FINERACT-263: Add Notes for Centers permission is missing #5346
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
base: develop
Are you sure you want to change the base?
FINERACT-263: Add Notes for Centers permission is missing #5346
Conversation
|
Hi reviewers, |
b9d85d4 to
de93454
Compare
adamsaghy
left a comment
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.
PR content has nothing to do with PR title...
Really sorry all changes did not got commited. I'll update it shortly. |
|
@Monica-CodingWorld squash and commit your changes, make sure that only 1 commit is in the PR. Also you have to test it in your local dev env. |
f737698 to
02188d7
Compare
@IOhacker Thank you for the guidance, i made all the changes. Best Regards, |
|
@Monica-CodingWorld could you please check the output https://github.com/apache/fineract/actions/runs/21178884898/job/61230181309?pr=5346 |
@IOhacker Thanks for the review. I've looked into the CI build failure. The error occurs because the addition of the centerId parameter to the CommandWrapper constructors requires updates in a few more places that instantiate the class. I have now identified and fixed these remaining instances (added null for the centerId parameter where appropriate) and have pushed the corrections. The build should pass now. |
|
:) always remember to squash and commit. Please help us with that. |
7df89fb to
bf4a8a2
Compare
|
@Monica-CodingWorld could you please take a look at https://github.com/apache/fineract/actions/runs/21319148523/job/61366891412?pr=5346 |
bf4a8a2 to
1b6f830
Compare
working on it, will update the PR shortly. |
@IOhacker @adamsaghy SpotBugs is failing on SF_SWITCH_NO_DEFAULT in NoteWritePlatformServiceJpaRepositoryImpl.getNoteForDelete() (missing default case in switch statement). This appears to be an existing issue that SpotBugs is now catching after the rebase. Should I:
(edited)For now - i have fixed the code with a default case regards |
- Add permission handling for center notes - Add Notes for Centers feature implementation
e51ee8e to
3876d06
Compare
| private final Long loanId; | ||
| private final Long savingsId; | ||
| @SuppressFBWarnings(value = "URF_UNREAD_FIELD", justification = "Will be used for center-specific permissions") | ||
| private final Long centerId; |
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.
Center is a group no? I would rather not introduce new field. Kindly asking you to use the entityId + entityName is needed instead.
| <Match> | ||
| <Class name="org.apache.fineract.commands.domain.CommandWrapper" /> | ||
| <Field name="centerId" /> | ||
| <Bug pattern="URF_UNREAD_FIELD" /> | ||
| </Match> |
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.
We dont want this rule to exclude!
| } | ||
| default -> resourceNameForPermissions = INVALIDNOTE; | ||
| case CENTER -> { | ||
| resourceNameForPermissions = CENTERNOTE; |
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.
There is no such permission... you must add it before it can be used!
adamsaghy
left a comment
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.
Kindly see my concerns + you need to add proper testing (integration test / E2E).
Hi @adamsaghy, Quick question on the SpotBugs fix - I actually already removed the exclusion and fixed the switch statement with a default case. Hope that's the right way to handle it? Will push the fixes shortly. Thanks again for the guidance. |
Description
This PR fixes missing permission handling for Center Notes in the Notes API.
Previously, when accessing notes for a CENTER resource, the request fell into the default case, resulting in a NoteResourceNotSupportedException. This allowed center notes to be accessed without proper, explicit permission mapping.
changes made:
Jira issue:- https://issues.apache.org/jira/projects/FINERACT/issues/FINERACT-263
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.