-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clear sharing policy store based on related resource deletion #433
Clear sharing policy store based on related resource deletion #433
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #433 +/- ##
============================================
+ Coverage 49.15% 49.21% +0.06%
- Complexity 1250 1258 +8
============================================
Files 142 143 +1
Lines 7873 7904 +31
Branches 972 973 +1
============================================
+ Hits 3870 3890 +20
- Misses 3679 3689 +10
- Partials 324 325 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
5c431ce
to
1b6bc50
Compare
.../java/org/wso2/carbon/identity/organization/management/handler/SharedRoleMgtHandlerTest.java
Show resolved
Hide resolved
PR builder started |
PR builder completed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/12965704278
Purpose
Resource sharing policies and the attached attributes for them will be stored in a generic data model.
Hence Resource types and Attributes types related data stored in above database table don't have foreignkey references.
For eg: If a user is deleted, the user sharing policies stored in the above tables need to be cleared through post event hadler / event listener of user delete action.
Similarly, we have to handle any supported resource type or attribute type.
Currently used resources are Users. Attaching to user sharing policies roles are used as attributes.
So, adding an event handler subscribed to POST_DELETE_ROLE_V2_EVENT and POST_USER_DELETE events.
On organization deletion, clearing the resource policies will be handled due to foreign key restrictions.
Fix: wso2/product-is#22434
Related PRs
Depends on #422