-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add delegate access restriction checks to approval, payment, reject and hold #78300
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
Add delegate access restriction checks to approval, payment, reject and hold #78300
Conversation
…earch and money request flows
|
@DylanDylann Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
| return; | ||
| } | ||
|
|
||
| if (isDelegateAccessRestricted) { |
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.
@mukhrr This change is for regression, Is there any other changes?
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.
Yes, this is the only one which #77609 mentioned
src/libs/actions/Search.ts
Outdated
| } = params; | ||
|
|
||
| // If delegate access is restricted, we should not allow bulk pay with business bank account or bulk pay | ||
| if (isDelegateAccessRestricted && 'value' in item && (item.value === CONST.IOU.PAYMENT_TYPE.ELSEWHERE || item.value === CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT)) { |
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.
| if (isDelegateAccessRestricted && 'value' in item && (item.value === CONST.IOU.PAYMENT_TYPE.ELSEWHERE || item.value === CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT)) { | |
| if (isDelegateAccessRestricted) { |
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 need this check. Pls, see our discussion with you in previous PR #75821 (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.
@mukhrr As I think every option in dropdown are pay options with diferent ways
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.
@DylanDylann Strangely, they are not. I mean there are options that is not related to pay when handleBulkPayItemSelected is clicked. Maybe we need to rename this func. Try to delete, move expense, etc. "So fast.. " modal shows for every one if we remove the check as you suggested.
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.
Yeah, thanks for explaining. I am afraid that we are missing other pay options
|
@mukhrr Please list out all actions that we need to prevent when users access as copilot |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-12-08.at.16.11.14.movAndroid: mWeb ChromeScreen.Recording.2025-12-08.at.16.05.51.moviOS: HybridAppScreen.Recording.2025-12-08.at.16.07.26.moviOS: mWeb SafariScreen.Recording.2025-12-08.at.16.05.14.movMacOS: Chrome / SafariScreen.Recording.2025-12-24.at.15.04.08.movScreen.Recording.2025-12-08.at.16.03.28.mov |
|
|
@mukhrr Which actions below action button on these places?
|
|
|
@mukhrr Could you resolve the conflict? Then I will check the last one |
@DylanDylann this is ready |
|
@mukhrr Please check the failed GH action |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/Gonals in version: 9.2.90-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.2.90-2 🚀
|
Explanation of Change
Fixed Issues
$ #75171
#77609
PROPOSAL: #75171 (comment)
Tests
Precondition:
User A has added User B as copilot with Limited access level.
→ Verify Copilot is presented with "Not so fast" modal because copilot with Limited access level cannot perform approval, payment, reject and hold action on the expenses.
→ Verify Copilot is presented with "Not so fast" modal
→ Verify Copilot is presented with "Not so fast" modal
→ Verify Copilot is presented with "Not so fast" modal
Offline tests
QA Steps
The same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
android_native.mp4
Android: mWeb Chrome
android_mWeb.mp4
iOS: Native
ios_native.mp4
iOS: mWeb Safari
ios_mWeb.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4