René's URL Explorer Experiment


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

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:e1619495-09c5-1f26-d904-1acecca76d84
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD6B0:3C8974:4F5D02:69DAFE:6A56E146
html-safe-noncefefb9b970c4b9b4b062d8d248e154edceedb557352bb7d746e659fe3a8287c4a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENkIwOjNDODk3NDo0RjVEMDI6NjlEQUZFOjZBNTZFMTQ2IiwidmlzaXRvcl9pZCI6IjEzNDQ4NTQ3MjU3NDE2OTkzOTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac78a850bcc21d2b8af71fe899c32d20de50b96480713739292528d645ffcca5aa
hovercard-subject-tagpull_request:2272223559
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/apache/cloudstack/pull/10176/files
twitter:imagehttps://avatars.githubusercontent.com/u/115510880?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/115510880?s=400&v=4
og:image:altDescription 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_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5220a278731283038daf0ed00b41f06ef7ff9539020ecc806c5c5a0fb6bda25a
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/apache/cloudstack git https://github.com/apache/cloudstack.git
octolytics-dimension-user_id47359
octolytics-dimension-user_loginapache
octolytics-dimension-repository_id9759448
octolytics-dimension-repository_nwoapache/cloudstack
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id9759448
octolytics-dimension-repository_network_root_nwoapache/cloudstack
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8684ae1a81cd3e4ef219b241179982bbda1a5b1f
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/apache/cloudstack/pull/10176/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fcloudstack%2Fpull%2F10176%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fcloudstack%2Fpull%2F10176%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=apache%2Fcloudstack
Reloadhttps://github.com/apache/cloudstack/pull/10176/files
Reloadhttps://github.com/apache/cloudstack/pull/10176/files
Reloadhttps://github.com/apache/cloudstack/pull/10176/files
Please reload this pagehttps://github.com/apache/cloudstack/pull/10176/files
apache https://github.com/apache
cloudstackhttps://github.com/apache/cloudstack
Notifications https://github.com/login?return_to=%2Fapache%2Fcloudstack
Fork 1.3k https://github.com/login?return_to=%2Fapache%2Fcloudstack
Star 3k https://github.com/login?return_to=%2Fapache%2Fcloudstack
Code https://github.com/apache/cloudstack
Issues 546 https://github.com/apache/cloudstack/issues
Pull requests 257 https://github.com/apache/cloudstack/pulls
Discussions https://github.com/apache/cloudstack/discussions
Actions https://github.com/apache/cloudstack/actions
Projects https://github.com/apache/cloudstack/projects
Wiki https://github.com/apache/cloudstack/wiki
Security and quality 0 https://github.com/apache/cloudstack/security
Insights https://github.com/apache/cloudstack/pulse
Code https://github.com/apache/cloudstack
Issues https://github.com/apache/cloudstack/issues
Pull requests https://github.com/apache/cloudstack/pulls
Discussions https://github.com/apache/cloudstack/discussions
Actions https://github.com/apache/cloudstack/actions
Projects https://github.com/apache/cloudstack/projects
Wiki https://github.com/apache/cloudstack/wiki
Security and quality https://github.com/apache/cloudstack/security
Insights https://github.com/apache/cloudstack/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fapache%2Fcloudstack%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fapache%2Fcloudstack%2Fissues%2Fnew%2Fchoose
DaanHooglandhttps://github.com/DaanHoogland
apache:4.19https://github.com/apache/cloudstack/tree/4.19
scclouds:check-for-network-permissionshttps://github.com/scclouds/cloudstack/tree/check-for-network-permissions
Conversation 10 https://github.com/apache/cloudstack/pull/10176
Commits 2 https://github.com/apache/cloudstack/pull/10176/commits
Checks 0 https://github.com/apache/cloudstack/pull/10176/checks
Files changed https://github.com/apache/cloudstack/pull/10176/files
Please reload this pagehttps://github.com/apache/cloudstack/pull/10176/files
Clean up network permissions on account deletion https://github.com/apache/cloudstack/pull/10176/files#top
Show all changes 2 commits https://github.com/apache/cloudstack/pull/10176/files
a331157 check whether account has network permissions before attempting to de… bernardodemarco Jan 11, 2025 https://github.com/apache/cloudstack/pull/10176/commits/a331157f06a0b9da48a40b75210ce6754ba3ba46
e63e07a clean up network permissions when an account is deleted bernardodemarco Jan 11, 2025 https://github.com/apache/cloudstack/pull/10176/commits/e63e07a3f0199fc862684103033e6587ac818c97
Clear filters https://github.com/apache/cloudstack/pull/10176/files
Please reload this pagehttps://github.com/apache/cloudstack/pull/10176/files
Please reload this pagehttps://github.com/apache/cloudstack/pull/10176/files
NetworkPermissionDao.java https://github.com/apache/cloudstack/pull/10176/files#diff-c3dec17c4c2815cad908b4d74de9c5e925256cc488b9d34cc39f14d2c2018db6
NetworkPermissionDaoImpl.java https://github.com/apache/cloudstack/pull/10176/files#diff-1129fc6d75a3e32238443de1f0eb255d5e490159329639b20549b34d2338ebdc
AccountManagerImpl.java https://github.com/apache/cloudstack/pull/10176/files#diff-fdd46eb6e71ed13aa5bc82ca928751e334a0e743c1142a0201a7cba7986882ff
AccountManagerImplTest.java https://github.com/apache/cloudstack/pull/10176/files#diff-9ee1a679f4c9f18ea68c7b9288a2cdb2b224b8cee933831a906337891c54dbb2
AccountManagetImplTestBase.java https://github.com/apache/cloudstack/pull/10176/files#diff-bbe5ee02b0f01442584d14f0928c28ba9d7440fa2a250fe6d4d77ed9a42bf3c3
engine/schema/src/main/java/org/apache/cloudstack/network/dao/NetworkPermissionDao.javahttps://github.com/apache/cloudstack/pull/10176/files#diff-c3dec17c4c2815cad908b4d74de9c5e925256cc488b9d34cc39f14d2c2018db6
View file https://github.com/scclouds/cloudstack/blob/e63e07a3f0199fc862684103033e6587ac818c97/engine/schema/src/main/java/org/apache/cloudstack/network/dao/NetworkPermissionDao.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/cloudstack/pull/10176/{{ revealButtonHref }}
https://github.com/apache/cloudstack/pull/10176/files#diff-c3dec17c4c2815cad908b4d74de9c5e925256cc488b9d34cc39f14d2c2018db6
https://github.com/apache/cloudstack/pull/10176/files#diff-c3dec17c4c2815cad908b4d74de9c5e925256cc488b9d34cc39f14d2c2018db6
engine/schema/src/main/java/org/apache/cloudstack/network/dao/NetworkPermissionDaoImpl.javahttps://github.com/apache/cloudstack/pull/10176/files#diff-1129fc6d75a3e32238443de1f0eb255d5e490159329639b20549b34d2338ebdc
View file https://github.com/scclouds/cloudstack/blob/e63e07a3f0199fc862684103033e6587ac818c97/engine/schema/src/main/java/org/apache/cloudstack/network/dao/NetworkPermissionDaoImpl.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/cloudstack/pull/10176/{{ revealButtonHref }}
https://github.com/apache/cloudstack/pull/10176/files#diff-1129fc6d75a3e32238443de1f0eb255d5e490159329639b20549b34d2338ebdc
https://github.com/apache/cloudstack/pull/10176/files#diff-1129fc6d75a3e32238443de1f0eb255d5e490159329639b20549b34d2338ebdc
https://github.com/apache/cloudstack/pull/10176/files#diff-1129fc6d75a3e32238443de1f0eb255d5e490159329639b20549b34d2338ebdc
https://github.com/apache/cloudstack/pull/10176/files#diff-1129fc6d75a3e32238443de1f0eb255d5e490159329639b20549b34d2338ebdc
server/src/main/java/com/cloud/user/AccountManagerImpl.javahttps://github.com/apache/cloudstack/pull/10176/files#diff-fdd46eb6e71ed13aa5bc82ca928751e334a0e743c1142a0201a7cba7986882ff
View file https://github.com/scclouds/cloudstack/blob/e63e07a3f0199fc862684103033e6587ac818c97/server/src/main/java/com/cloud/user/AccountManagerImpl.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/cloudstack/pull/10176/{{ revealButtonHref }}
https://github.com/apache/cloudstack/pull/10176/files#diff-fdd46eb6e71ed13aa5bc82ca928751e334a0e743c1142a0201a7cba7986882ff
https://github.com/apache/cloudstack/pull/10176/files#diff-fdd46eb6e71ed13aa5bc82ca928751e334a0e743c1142a0201a7cba7986882ff
https://github.com/apache/cloudstack/pull/10176/files#diff-fdd46eb6e71ed13aa5bc82ca928751e334a0e743c1142a0201a7cba7986882ff
https://github.com/apache/cloudstack/pull/10176/files#diff-fdd46eb6e71ed13aa5bc82ca928751e334a0e743c1142a0201a7cba7986882ff
https://github.com/apache/cloudstack/pull/10176/files#diff-fdd46eb6e71ed13aa5bc82ca928751e334a0e743c1142a0201a7cba7986882ff
https://github.com/apache/cloudstack/pull/10176/files#diff-fdd46eb6e71ed13aa5bc82ca928751e334a0e743c1142a0201a7cba7986882ff
https://github.com/apache/cloudstack/pull/10176/files#diff-fdd46eb6e71ed13aa5bc82ca928751e334a0e743c1142a0201a7cba7986882ff
https://github.com/apache/cloudstack/pull/10176/files#diff-fdd46eb6e71ed13aa5bc82ca928751e334a0e743c1142a0201a7cba7986882ff
server/src/test/java/com/cloud/user/AccountManagerImplTest.javahttps://github.com/apache/cloudstack/pull/10176/files#diff-9ee1a679f4c9f18ea68c7b9288a2cdb2b224b8cee933831a906337891c54dbb2
View file https://github.com/scclouds/cloudstack/blob/e63e07a3f0199fc862684103033e6587ac818c97/server/src/test/java/com/cloud/user/AccountManagerImplTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/cloudstack/pull/10176/{{ revealButtonHref }}
https://github.com/apache/cloudstack/pull/10176/files#diff-9ee1a679f4c9f18ea68c7b9288a2cdb2b224b8cee933831a906337891c54dbb2
server/src/test/java/com/cloud/user/AccountManagetImplTestBase.javahttps://github.com/apache/cloudstack/pull/10176/files#diff-bbe5ee02b0f01442584d14f0928c28ba9d7440fa2a250fe6d4d77ed9a42bf3c3
View file https://github.com/scclouds/cloudstack/blob/e63e07a3f0199fc862684103033e6587ac818c97/server/src/test/java/com/cloud/user/AccountManagetImplTestBase.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/cloudstack/pull/10176/{{ revealButtonHref }}
https://github.com/apache/cloudstack/pull/10176/files#diff-bbe5ee02b0f01442584d14f0928c28ba9d7440fa2a250fe6d4d77ed9a42bf3c3
https://github.com/apache/cloudstack/pull/10176/files#diff-bbe5ee02b0f01442584d14f0928c28ba9d7440fa2a250fe6d4d77ed9a42bf3c3
https://github.com/apache/cloudstack/pull/10176/files#diff-bbe5ee02b0f01442584d14f0928c28ba9d7440fa2a250fe6d4d77ed9a42bf3c3
https://github.com/apache/cloudstack/pull/10176/files#diff-bbe5ee02b0f01442584d14f0928c28ba9d7440fa2a250fe6d4d77ed9a42bf3c3
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.