CaptainAni187 commented on code in PR #822:
URL:
https://github.com/apache/fineract-backoffice-ui/pull/822#discussion_r4401765380
##########
src/app/features/clients/client-view.component.ts:
##########
@@ -441,6 +442,23 @@ export type ClientTab = (typeof CLIENT_TAB)[keyof typeof
CLIENT_TAB];
<ion-label>{{ 'ACTIONS.UNDO_WITHDRAW_CLIENT' |
appTranslate }}</ion-label>
</ion-item>
}
+ <ion-item
+ button
+ (click)="onViewCharges()"
+ data-testid="client-charges-action"
+ appRequiresPermission="READ_CLIENTCHARGE"
+ >
+ <ion-icon slot="start" name="receipt-outline"></ion-icon>
+ <ion-label>{{ 'CLIENT_CHARGES.TITLE' | appTranslate
}}</ion-label>
+ </ion-item>
+ <ion-item
+ button
+ (click)="onViewCollateral()"
Review Comment:
Thanks, gated it now. One thing though.... READ_CLIENT_COLLATERAL_PRODUCT
isn't a grantable code. SecurityConfig checks it, but the permission table only
gets CREATE/UPDATE/DELETE rows for CLIENT_COLLATERAL_PRODUCT
(0000_upgrade_to_1.6.xml), so it's not in scripts/permission-codes.json and
check:permission-codes rejects it. In practice only ALL_FUNCTIONS and
ALL_FUNCTIONS_READ can read client collateral, so I gated the item on
ALL_FUNCTIONS_READ, which permissionsSatisfy grants to exactly those two. Added
an e2e check that READ_CLIENT + ACTIVATE_CLIENT gets it disabled and
ALL_FUNCTIONS_READ gets it enabled.
I left the route as is, since check-route-permissions.mjs lists
/clients/:clientId/collaterals as deliberately unrestricted for the same reason
(no READ code in the catalogue). Happy to gate the route on ALL_FUNCTIONS_READ
too and drop that exemption if you'd prefer.
##########
src/app/features/clients/client-view.component.ts:
##########
@@ -256,6 +256,7 @@ export type ClientTab = (typeof CLIENT_TAB)[keyof typeof
CLIENT_TAB];
'ASSIGNSTAFF_CLIENT',
'UNASSIGNSTAFF_CLIENT',
'UPDATESAVINGSACCOUNT_CLIENT',
+ 'READ_CLIENTCHARGE',
Review Comment:
Added ALL_FUNCTIONS_READ to the trigger's list, so a read-only user still
gets the Actions button. Also added the CREATE_SHAREACCOUNT gated Create Share
Account button on the empty Shares tab, same as Loans and Savings (renamed the
menu item's test id to client-new-share-account-action so the empty-state one
matches the others).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]