You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WEB-1543: Use Fineract's permission codes for Provisioning Entries - #4373
With MIFOS_PRODUCTION_MODE_ENABLE_RBAC=true, the Provisioning Entries screens check permission codes that don't exist in Fineract, so only super users (ALL_FUNCTIONS) see them. The menu entry is hidden even for ALL_FUNCTIONS_READ.
This PR uses Fineract's codes:
Where
Before
After
Accounting > Provisioning Entries (menu entry)
VIEW_PROVISIONING_ENTRIES
READ_PROVISIONENTRIES
Provisioning Entries > Create Provisioning Entry
VIEW_ALL_PROVISIONING_ENTRIES
CREATE_PROVISIONENTRIES
Create Provisioning Entry > Submit
CREATE_PROVISIONING_ENTRIES
CREATE_PROVISIONENTRIES
Provisioning Entry > Create Journal Entries
CREATE_JOURNAL_ENTRY
CREATE_PROVISIONJOURNALENTRIES
The Create Provisioning Entry button uses the create permission rather than the read one, so read-only users don't get a button whose form they can't submit. Prettier collapses that button's attributes onto one line now that the code is shorter.
Tested in Chromium against Fineract develop with RBAC on, as a user whose role has only READ_PROVISIONENTRIES, CREATE_PROVISIONENTRIES, CREATE_PROVISIONJOURNALENTRIES, plus READ_LOANPRODUCT, READ_PROVISIONCATEGORY and READ_OFFICE (the entry page loads these): before, the menu entry and all three buttons are hidden; after, all of them show. ESLint and Prettier pass. No new dependencies.
If you have multiple commits please combine them into one commit by squashing them.
Read and understood the contribution guidelines at web-app/.github/CONTRIBUTING.md.
Summary by CodeRabbit
Access
The Provisioning Entries menu and entry creation controls now follow the updated read and create permissions.
Creating provisioning journal entries now follows the updated journal-entry permission. The available actions continue to depend on the permissions assigned to your account.
The Accounting menu entry, Create Provisioning Entry, Submit and Create
Journal Entries checked codes that don't exist in Fineract, so with RBAC
enabled only super users saw them.
Reviewing files that changed from the base of the PR and between a745de3 and 79b5c93.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
Note
.coderabbit.yaml has unrecognized properties
CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.
Parsing warnings: 2
Validation error: Unrecognized key: "instructions" at "reviews"; Unrecognized key: "pre_merge_checks"
If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
No actionable comments were generated in the recent review.
Walkthrough
The Provisioning Entries menu item and related actions now check updated permission names. The changes affect the menu, provisioning-entry creation, and journal-entry creation.
The menu item now checks READ_PROVISIONENTRIES. Both provisioning-entry creation buttons now check CREATE_PROVISIONENTRIES. The journal-entry creation button now checks CREATE_PROVISIONJOURNALENTRIES.
This change updates the permission names that control the Provisioning Entries menu and its buttons. No concrete defect has been established, so it looks safe to merge. The one open question is whether the journal-entries checkbox on the create form should require its own permission, and that is enforced by the server.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: switching the Provisioning Entries permission checks to Fineract's permission codes. The raw summary confirms the menu, create, submit, and journal-entry permission ch…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: switching the Provisioning Entries permission checks to Fineract's permission codes. The raw summary confirms the menu, create, submit, and journal-entry permission checks all change to the codes named in the title. The title is specific and matches the changeset, so it passes.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
With
MIFOS_PRODUCTION_MODE_ENABLE_RBAC=true, the Provisioning Entries screens check permission codes that don't exist in Fineract, so only super users (ALL_FUNCTIONS) see them. The menu entry is hidden even forALL_FUNCTIONS_READ.This PR uses Fineract's codes:
VIEW_PROVISIONING_ENTRIESREAD_PROVISIONENTRIESVIEW_ALL_PROVISIONING_ENTRIESCREATE_PROVISIONENTRIESCREATE_PROVISIONING_ENTRIESCREATE_PROVISIONENTRIESCREATE_JOURNAL_ENTRYCREATE_PROVISIONJOURNALENTRIESThe Create Provisioning Entry button uses the create permission rather than the read one, so read-only users don't get a button whose form they can't submit. Prettier collapses that button's attributes onto one line now that the code is shorter.
Tested in Chromium against Fineract develop with RBAC on, as a user whose role has only
READ_PROVISIONENTRIES,CREATE_PROVISIONENTRIES,CREATE_PROVISIONJOURNALENTRIES, plusREAD_LOANPRODUCT,READ_PROVISIONCATEGORYandREAD_OFFICE(the entry page loads these): before, the menu entry and all three buttons are hidden; after, all of them show. ESLint and Prettier pass. No new dependencies.Related issues and discussion
Screenshots, if any
Checklist
If you have multiple commits please combine them into one commit by squashing them.
Read and understood the contribution guidelines at
web-app/.github/CONTRIBUTING.md.Summary by CodeRabbit