[CP Staging] fix: workspace member is removable when he is the report owner#50870
Conversation
|
@eVoloshchak 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] |
|
@eVoloshchak Please check this as a regression from #48931. |
|
I can't login on Android, it always tells |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-10-17.at.2.26.21.AM.movAndroid: mWeb ChromeScreen.Recording.2024-10-17.at.2.25.07.AM.moviOS: NativeScreen.Recording.2024-10-17.at.2.27.04.AM.moviOS: mWeb SafariScreen.Recording.2024-10-17.at.2.28.11.AM.movMacOS: Chrome / SafariScreen.Recording.2024-10-17.at.2.22.19.AM.movScreen.Recording.2024-10-17.at.2.21.36.AM.movMacOS: DesktopScreen.Recording.2024-10-17.at.2.24.02.AM.mov |
| */ | ||
| const isUserPolicyAdmin = (policy: OnyxInputOrEntry<Policy>, login?: string) => !!(policy && policy.employeeList && login && policy.employeeList[login]?.role === CONST.POLICY.ROLE.ADMIN); | ||
|
|
||
| /** |
There was a problem hiding this comment.
Why are we introducing a new check here ?, we already have a util which checks this:
Lines 197 to 201 in 0b3569a
There was a problem hiding this comment.
This will break the checklist check:
I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
Unless i am missing something there
There was a problem hiding this comment.
Ohh i get it now, the end user in this case, No worries, sorry for the confusion
@marcaaron is this expected that normal user can remove member from workspace ? the screenshot from @dominictb contains this screenshot
|
|
@marcaaron in @dominictb screenshots, he has indicated that if a member opens up the participants page he would be able to remove another member in the chat, we block this action only when the current user is admin, is this expected? |
|
@allgandalf Can you list out the exact steps that lead to whatever you think the bug is? in the steps from the description it says from the perspective of the admin so I'm not sure what you mean by "if a member opens up the participants page he would be able to remove another member in the chat". |
|
Ohh actually @marcaaron nevermind, I read both the issues and got to know the context, by screenshots of @dominictb i got the feeling that the remove member option is visible to members too, but alright now thanks :) |
fix: workspace member is removable when he is the report owner (cherry picked from commit d03e796) (CP triggered by marcaaron)
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Cherry-picked to staging by https://github.com/marcaaron in version: 9.0.49-2 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.0.49-2 🚀
|

Details
Fixed Issues
$ #48931
$ #50771
PROPOSAL:
Tests
Remove from chatbutton is disabledRemove from chatbutton is disabledOffline tests
NA
QA Steps
See Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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: mWeb Chrome
Screen.Recording.2024-10-16.at.17.59.38.mov
iOS: Native
Screen.Recording.2024-10-16.at.17.54.51.mov
iOS: mWeb Safari
Screen.Recording.2024-10-16.at.17.57.05.mov
MacOS: Chrome / Safari
MacOS: Desktop