-
-
Notifications
You must be signed in to change notification settings - Fork 773
[Bug]: Cannot delete Portal when Portal Permissions exist #6434
Copy link
Copy link
Labels
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
What happened?
I tried to delete a portal, but got a SQL error.
Steps to reproduce?
- Create a portal (Don't think you can delete a portal if your instance only has one)
- Create a role
- Set up at least one portal permission for that role
- (Try to) delete that portal via the sites menu
Current Behavior
Foreign key error on the RoleID column of the PortalPermission table, probably when trying to cascade delete roles for the portal in question.
Expected Behavior
Portal is deleted without error.
Relevant log output
Error executing SQL: ;Exec dbo.DeletePortalInfo @0
The DELETE statement conflicted with the REFERENCE constraint "FK_PortalPermission_RoleId". The conflict occurred in database "<my database>", table "dbo.PortalPermission", column 'RoleID'.Anything else?
The FKs on PortalPermission are missing cascade delete on PortalId, PermissionId, RoleID, and UserID. I suspect this would happen if trying to delete the Portal, Permission, Role, or User associated with Portal Permissions.
Portal Permissions were added in 9.11.0 and not touched since, so this almost certainly affects all versions since then.
Affected Versions
9.13.8 (RC), 9.13.7 (latest release), 10.0.0 (RC)
What browsers are you seeing the problem on?
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable