Skip to content
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

Whisper to admin and auditor when their role is changed to user #49634

Open
garrettmknight opened this issue Sep 24, 2024 · 15 comments
Open

Whisper to admin and auditor when their role is changed to user #49634

garrettmknight opened this issue Sep 24, 2024 · 15 comments
Assignees
Labels
Internal Requires API changes or must be handled by Expensify staff NewFeature Something to build that is a new item. Weekly KSv2

Comments

@garrettmknight
Copy link
Contributor

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: N/A
Reproducible in staging?: N
Reproducible in production?: N
Expensify/Expensify Issue URL:
Issue reported by: @JmillsExpensify
Slack conversation: https://expensify.slack.com/archives/C06ML6X0W9L/p1727169064223989?thread_ts=1726494273.889699&cid=C06ML6X0W9L

Problem

When we change a user's role from Admin or Auditor to user we remove them from all workspace chats they had access to, except for their own. Since they've been removed from the #admins room for the workspace, they won't have any context on their role change or why they no longer have access to the chats they once did.

Solution

Similar to how we handle approvers who are removed from workspace chats (PR for that here), we'll send a whisper to admins and auditors in their workspace chat when their role is updated and access to other workspace chats is removed.

Admin copy for the whisper:

[Admin] updated your role in [Workspace Name] from admin to user. You have been removed from all submitter workspace chats except for your own.

Auditor copy for the whisper:

[Admin] updated your role in [Workspace Name] from auditor to user. You have been removed from all submitter workspace chats except for your own.

Platforms:

All

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

@garrettmknight garrettmknight added Daily KSv2 Internal Requires API changes or must be handled by Expensify staff NewFeature Something to build that is a new item. labels Sep 24, 2024
@garrettmknight garrettmknight added the Hot Pick Ready for an engineer to pick up and run with label Sep 24, 2024
Copy link

melvin-bot bot commented Sep 24, 2024

Triggered auto assignment to @bfitzexpensify (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added Weekly KSv2 Overdue and removed Daily KSv2 labels Sep 24, 2024
@bfitzexpensify
Copy link
Contributor

Remains a hot pick, waiting to be picked up

@melvin-bot melvin-bot bot removed the Overdue label Oct 1, 2024
@melvin-bot melvin-bot bot added the Overdue label Oct 9, 2024
@bfitzexpensify
Copy link
Contributor

Remains a hot pick, waiting to be picked up

@melvin-bot melvin-bot bot removed the Overdue label Oct 10, 2024
@dylanexpensify dylanexpensify moved this to Release 3: Fall 2024 (Nov) in [#whatsnext] #expense Oct 18, 2024
@melvin-bot melvin-bot bot added the Overdue label Oct 18, 2024
@bfitzexpensify
Copy link
Contributor

Same update - remains a hot pick, waiting to be picked up. Weekly still seems right to me

@melvin-bot melvin-bot bot removed the Overdue label Oct 23, 2024
@melvin-bot melvin-bot bot added the Overdue label Oct 31, 2024
@bfitzexpensify
Copy link
Contributor

Remains a hot pick, waiting to be picked up.

@melvin-bot melvin-bot bot removed the Overdue label Nov 6, 2024
@blimpich blimpich self-assigned this Nov 13, 2024
@blimpich
Copy link
Contributor

blimpich commented Nov 13, 2024

Picking up. Initial investigation shows this is where we update a modified user's role in Web. Command is UpdateWorkspaceMembersRole. Will continue looking into this tomorrow. Questions I need to answer:

  • do we have the ability to add whisper messages from web? From auth?
  • would it violate 1:1:1 to add code in Web that created these whispers?

@blimpich
Copy link
Contributor

blimpich commented Nov 14, 2024

To answer my own questions, we have the ability to add whisper messages both from Auth and Web. But, since UpdateWorkspaceMembersRole is not 1:1:1 (more so than most commands) its not possible to do this in Auth right now. And while its feasible to do this from Web it would require loading the downgraded User's entire list of chat reports, which makes this flow even more in violation of our 1:1:1 principle.

Maybe there is another engineer who can see something that I can't, but might need to take a raincheck for this issue. Going to unassign this from myself for now since I can't prioritize it given how much work it would be to make it comply with 1:1:1.

@blimpich blimpich removed their assignment Nov 14, 2024
@melvin-bot melvin-bot bot added the Overdue label Nov 22, 2024
@bfitzexpensify
Copy link
Contributor

Remains a hot pick and available for the taking

@melvin-bot melvin-bot bot removed the Overdue label Nov 22, 2024
@melvin-bot melvin-bot bot added the Overdue label Dec 2, 2024
@bfitzexpensify
Copy link
Contributor

Still waiting on a volunteer, remains low priority

@melvin-bot melvin-bot bot removed the Overdue label Dec 3, 2024
@melvin-bot melvin-bot bot added the Overdue label Dec 12, 2024
@bfitzexpensify
Copy link
Contributor

Same update, waiting on a volunteer

@melvin-bot melvin-bot bot removed the Overdue label Dec 18, 2024
@tgolen
Copy link
Contributor

tgolen commented Dec 19, 2024

The UpdateWorkspaceMembersRole command uses PolicyAPI::mergeEmployees() under the hood. I think it would be very simple to make UpdateWorkspaceMembersRole call straight to Auth (adding a new UpdateWorkspaceMembersRole command to Auth), and having it use the policy merge stuff in Auth that has already been written and in use for quite some time. This would refactor the command to be 1:1:1.

@flodnv @iwiznia do you agree? If so, I can get it moved and implement this whisper I don't think it should take too much work.

@iwiznia
Copy link
Contributor

iwiznia commented Dec 19, 2024

Don't know the full details, but I think as long as we are only changing the role it should be fine. If we are inviting/uninviting then there's probably more to it.

@flodnv
Copy link
Contributor

flodnv commented Dec 20, 2024

+1, though it would be good to double check. For example, it seems like this logic would apply if changing the role to admin. Perhaps there's more.

@melvin-bot melvin-bot bot added the Overdue label Dec 26, 2024
@bfitzexpensify
Copy link
Contributor

Remains a hot pick - sounds like perhaps we have an idea of a solution @tgolen?

@melvin-bot melvin-bot bot removed the Overdue label Jan 7, 2025
@tgolen
Copy link
Contributor

tgolen commented Jan 7, 2025

Yeah, I can take this and begin working on it.

@tgolen tgolen self-assigned this Jan 7, 2025
@tgolen tgolen removed the Hot Pick Ready for an engineer to pick up and run with label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal Requires API changes or must be handled by Expensify staff NewFeature Something to build that is a new item. Weekly KSv2
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

6 participants