Skip to content

kcm/users: refine "deleting logged-in user" UX

Reason for the change

Right now there are two problems:

  1. Deleting a logged-in user shows no warning about this.
  2. Asking to delete the files of a logged-in user fails silently (AccountsService simply won't do it).

This commit solves both problems: now the user sees a warning dialog when they try to delete another logged-in user, and it also prevents them from trying to delete a logged-in user's files, instead redirecting them to just delete the account but not the files.

To achieve this, I needed to change what the loggedIn property does, because previously it was inaccurate, returning whether the queried user is the currently logged-in user. Now it returns whether the quaried user is logged in, and I added a new isMe property to hold whether the queried user is the currently logged-in user.

Test plan

  1. Create a new user account.
  2. Log into it.
  3. Without logging out of it, switch back to your main user account.
  4. Use this KCM to try to delete the new user account using either file deletion option.

Then do it again, omitting steps 2 and 3.

Screenshots or screen recordings

Deleting logged-in account Deleting logged-in account and attempting to delete files as well
Just_delete_account Just_delete_account_when_asked_to_do_something_impossible

Bugs fixed

BUG: 495494
FIXED-IN: 6.4.0

@teams/usability

Merge request reports

Loading