Don't allow users to remove their account or user. - #7242
Conversation
|
@soreana |
|
@weizhouapache I guess we can disable that in the backend as well, but I think anyone who uses the API, or the CloudMonkey knows what he does. So, I didn't disable that. Another reason was that in the UI we are not able to delete other admin but we can do that using the CloudMonkey. |
Codecov Report
@@ Coverage Diff @@
## main #7242 +/- ##
=========================================
Coverage 12.67% 12.67%
Complexity 8639 8639
=========================================
Files 2716 2716
Lines 256112 256112
Branches 39926 39926
=========================================
Hits 32456 32456
Misses 219528 219528
Partials 4128 4128 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
@soreana I tested these changes manually, I do not know if my environment is too slow, but if I am fast enough, I can click the delete button before it becomes disabled. I'm not sure how to fix this though... |
@JoaoJandre I guess the issue is related to the way UI is loaded. I'm not sure if I can control that, that is beyond my knowledge 😃 |
|
@kiranchavala a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
|
@soreana Tested the ui LGTM The delete account icon is graded out when trying to delete its own account , The delete account icon is not graded out when trying to delete other accounts |
JoaoJandre
left a comment
There was a problem hiding this comment.
Apart from the one caveat I mentioned, it worked fine in my tests and the code looks good to me.
|
@harikrishna-patnala Can you please check this pr when you have time? Thanks. |
kiranchavala
left a comment
There was a problem hiding this comment.
LGTM, tested the changes

Description
Cloudstack users can delete their account accidentally and lock themselves from accessing the CloudStack panel. A link to an account placed next to ISO, template, VM and other entities in CloudStack's UI. If customers doesn't paying attention, they would click on the account link instead of the link to the entity they want (vm, template, ISO etc.) Then, if they had wanted to delete that entity, they would press delete button without realising they were on the account page, and press Confirm.
Mailing list [thread]
This PR don't allow users to remove their account or their user.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Screenshots (if appropriate):
Remove.user.mp4
How Has This Been Tested?
Acc1andAcc2.Acc1Acc1page, delete button isnotthere.Acc2page, delete button is there.Acc2Acc1but not for yourself.