Title: Clean up network permissions on account deletion by bernardodemarco · Pull Request #10176 · apache/cloudstack · GitHub
Open Graph Title: Clean up network permissions on account deletion by bernardodemarco · Pull Request #10176 · apache/cloudstack
X Title: Clean up network permissions on account deletion by bernardodemarco · Pull Request #10176 · apache/cloudstack
Description: Description Currently, if an account with network permissions for guest networks is deleted, CloudStack does not automatically delete these permissions, and operators cannot delete them later through the APIs. The workaround for this scenario is to manually remove the permissions entries from the cloud.network_permissions table. Therefore, this PR proposes to clean up the network permissions of an account when it is deleted. Additionally, when attempting to delete an account that is a project administrator, an error message is returned. This error message has been enhanced to include instructions on the next steps the operator should perform to properly delete the given account. Fixes #10103 Types of changes Breaking change (fix or feature that would cause existing functionality to change) New feature (non-breaking change which adds functionality) Bug fix (non-breaking change which fixes an issue) Enhancement (improves an existing feature and functionality) Cleanup (Code refactoring and cleanup, that may add test cases) build/CI test (unit or integration test code) Feature/Enhancement Scale or Bug Severity Feature/Enhancement Scale Major Minor Screenshots (if appropriate): How Has This Been Tested? First, I created a domain ROOT/d1, a domain admin (d1) and two regular users within it (u1 and u2). With the d1 account, I created a project and added the u1 account as a project administrator. When attempting to delete the u1 account, an error message was returned, indicating that the account was a project administrator. After demoting the account to a regular project role, I created two guest networks and granted permission to both u1 and u2 accounts. MariaDB [cloud]> select * from network_permissions; +----+------------+------------+ | id | network_id | account_id | +----+------------+------------+ | 8 | 209 | 14 | | 9 | 209 | 16 | | 10 | 210 | 16 | | 11 | 210 | 14 | +----+------------+------------+ 4 rows in set (0.001 sec) Then, I deleted the u1 account, which has a serial ID equal to 16, and verified that the network permissions were correctly expunged: MariaDB [cloud]> select * from network_permissions; +----+------------+------------+ | id | network_id | account_id | +----+------------+------------+ | 8 | 209 | 14 | | 11 | 210 | 14 | +----+------------+------------+ 2 rows in set (0.001 sec) I reproduced these same steps with the u2 account and verified that the network permissions were also correctly deleted.
Open Graph Description: Description Currently, if an account with network permissions for guest networks is deleted, CloudStack does not automatically delete these permissions, and operators cannot delete them later throu...
X Description: Description Currently, if an account with network permissions for guest networks is deleted, CloudStack does not automatically delete these permissions, and operators cannot delete them later throu...
Opengraph URL: https://github.com/apache/cloudstack/pull/10176
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:e1619495-09c5-1f26-d904-1acecca76d84 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D6B0:3C8974:4F5D02:69DAFE:6A56E146 |
| html-safe-nonce | fefb9b970c4b9b4b062d8d248e154edceedb557352bb7d746e659fe3a8287c4a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENkIwOjNDODk3NDo0RjVEMDI6NjlEQUZFOjZBNTZFMTQ2IiwidmlzaXRvcl9pZCI6IjEzNDQ4NTQ3MjU3NDE2OTkzOTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 78a850bcc21d2b8af71fe899c32d20de50b96480713739292528d645ffcca5aa |
| hovercard-subject-tag | pull_request:2272223559 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/apache/cloudstack/pull/10176/files |
| twitter:image | https://avatars.githubusercontent.com/u/115510880?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/115510880?s=400&v=4 |
| og:image:alt | Description Currently, if an account with network permissions for guest networks is deleted, CloudStack does not automatically delete these permissions, and operators cannot delete them later throu... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5220a278731283038daf0ed00b41f06ef7ff9539020ecc806c5c5a0fb6bda25a |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/apache/cloudstack git https://github.com/apache/cloudstack.git |
| octolytics-dimension-user_id | 47359 |
| octolytics-dimension-user_login | apache |
| octolytics-dimension-repository_id | 9759448 |
| octolytics-dimension-repository_nwo | apache/cloudstack |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 9759448 |
| octolytics-dimension-repository_network_root_nwo | apache/cloudstack |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8684ae1a81cd3e4ef219b241179982bbda1a5b1f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width