Automattic / Automattic/wp-calypso

Users that own upgrades can be removed from sites

Closed
#27,481 19 comments 0 reactions 0 assignees Claimed by @arasaraskocaoglan View on GitHub
[Feature] Purchase Management [Platform] Atomic [Platform] Simple Customer Report > Direct Customer signal > Cleaned PE Journey: Existential PE Score: 2. Significant PE Segment: General People Management Quality Sprint: Week 2 Support Rotation Top CX-impacting issues User Management WordPress.com
Dominant language
TypeScript
Stars
12.6k
Forks
2k
Avg merge
1d 17h
Merged PRs (30d)
552

Description

#### Steps to reproduce

1. Create a free [WordPress.com]() site
2. Add a new administrator to the site
3. As the new administrator, purchase a site upgrade
4. As the new administrator, attempt to remove the site owner
5. As the site owner, remove the new administrator who owns the upgrade
6. As the new administrator, attempt to renew or manage the upgraded purchase

#### What I expected

When removing the site owner, an error is returned:

![annotation on 2018-8-4](https://uploads.linear.app/f629fcde-6f9b-48e8-8af3-60eed8823bff/5cb72465-66e0-484e-8dfe-de4acdf88846/985421e2-bdb7-4137-af53-08dd9f42e77d?signature=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXRoIjoiL2Y2MjlmY2RlLTZmOWItNDhlOC04YWYzLTYwZWVkODgyM2JmZi81Y2I3MjQ2NS02NmUwLTQ4NGUtOGRmZS1kZTRhY2RmODg4NDYvOTg1NDIxZTItYmRiNy00MTM3LWFmNTMtMDhkZDlmNDJlNzdkIiwiaWF0IjoxNzg1MjU3ODcxLCJleHAiOjE4MTY4Mjg0MzF9.CaazSYI3ao4v7P6IqVXaMJMZnHDCha2y7AtoSGZ3BF8)

This would be the preferred behavior when an attempt is made to remove a user that owns an upgrade, as well.

#### What happened instead

Instead, the upgrade owner is removed:

![screen shot on 2018-09-27 at 13 26 36](https://uploads.linear.app/f629fcde-6f9b-48e8-8af3-60eed8823bff/b0cb8c55-f032-4f50-a5db-691a55a518f2/55791845-d3fc-4e26-af92-13b052c51f0a?signature=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXRoIjoiL2Y2MjlmY2RlLTZmOWItNDhlOC04YWYzLTYwZWVkODgyM2JmZi9iMGNiOGM1NS1mMDMyLTRmNTAtYTVkYi02OTFhNTVhNTE4ZjIvNTU3OTE4NDUtZDNmYy00ZTI2LWFmOTItMTNiMDUyYzUxZjBhIiwiaWF0IjoxNzg1MjU3ODcxLCJleHAiOjE4MTY4Mjg0MzF9.08T_gBn810OepQDme4MeOPOn0kdnGTsiNteiMKPN5vc)

And that user can't access the site to manage the plan that they own:

![screen shot on 2018-09-27 at 13 28 46](https://uploads.linear.app/f629fcde-6f9b-48e8-8af3-60eed8823bff/4d50dead-fb8c-4cf3-ba81-87cc7a58b087/0546a23b-1e41-4fb1-8df0-9c5b1ebabd7c?signature=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXRoIjoiL2Y2MjlmY2RlLTZmOWItNDhlOC04YWYzLTYwZWVkODgyM2JmZi80ZDUwZGVhZC1mYjhjLTRjZjMtYmE4MS04N2NjN2E1OGIwODcvMDU0NmEyM2ItMWU0MS00ZmIxLThkZjAtOWM1YjFlYmFiZDdjIiwiaWF0IjoxNzg1MjU3ODcxLCJleHAiOjE4MTY4Mjg0MzF9.nmJ_raxud9-R7lcRxj5n4eYTrWn8RL2Nfx_wJ0sJlb8)

The site owner can't access it as well.

![screen shot on 2018-09-27 at 13-29-09](https://uploads.linear.app/f629fcde-6f9b-48e8-8af3-60eed8823bff/4066b841-3fb9-4643-a119-da2d55b74eae/749bf79b-5067-41ec-8e83-b197223d51ea?signature=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXRoIjoiL2Y2MjlmY2RlLTZmOWItNDhlOC04YWYzLTYwZWVkODgyM2JmZi80MDY2Yjg0MS0zZmI5LTQ2NDMtYTExOS1kYTJkNTViNzRlYWUvNzQ5YmY3OWItNTA2Ny00MWVjLThlODMtYjE5NzIyM2Q1MWVhIiwiaWF0IjoxNzg1MjU3ODcxLCJleHAiOjE4MTY4Mjg0MzF9.mBeCsF7e-lEF1L5sV-gMV9C5hix11FCNXKxxsSGrAFQ)

This leaves the site in a state where the plan can't be renewed without several steps involving coordinating with support to resolve the issue.

The better solution would be to prevent the user from being removed and giving the user the reason why they can't be removed (they own the upgrade(s) to the account) and what can be done if they need to be removed (transfer ownership of the upgrade(s) first).

#### Browser / OS version

Browser-independent

#### Screenshot / Video

Above

#### Context / Source

This has come up at different times, especially in the Account Recovery queue.

Two recent examples are 1443076-zen and 1392450-zen

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by tracing the site-user removal flow and the upgrade ownership checks from the reproduction steps. Done means a user who owns upgrades cannot be removed, receives the reason, and is told to transfer upgrade ownership first.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authorization, payments
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.