Skip to content
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

Add Method to Delete Resource Sharing Policy in a Given Organization by Resource Type and ID #423

Conversation

BimsaraBodaragama
Copy link
Contributor

This PR introduces a new method to the ResourceSharingPolicyHandlerService interface for deleting resource-sharing policies of a specified resource type and ID within a given policy-holding organization. The method ensures proper permission checks for the initiating organization before deletion as well.

Purpose

TThis addition addresses the need to delete specific resource sharing policies within a specified policy-holding organization while validating permissions of the initiating organization. It resolves the following issues:

Goals

  • Enable deletion of resource-sharing policies within a specified policy-holding organization.
  • Provide precise control by targeting resource type and ID.
  • Validate the initiating organization’s permissions before proceeding with the deletion.

Approach

  • Introduced the deleteResourceSharingPolicyInOrgByResourceTypeAndId method in the service interface.
  • Implemented the method using a parameterized SQL query in the DAO layer.
  • Validated the policy-holding organization and initiating organization IDs for proper permission checks.
  • Added exception handling to manage database access issues gracefully.

Release note

Added a new method to delete resource-sharing policies within a specified policy-holding organization based on resource type and ID, with validation for initiating organization permissions.

Documentation

N/A (Documentation updates will be tracked separately.)

Test environment

  • JDK 11
  • macOS 15.1.1 (24B91)
  • H2 Database

Related Issue

Add Method to Delete Resource Sharing Policy in a Given Organization by Resource Type and ID #22250

Copy link

codecov bot commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.22%. Comparing base (0e528bf) to head (4b3bc82).
Report is 21 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #423      +/-   ##
============================================
+ Coverage     48.12%   48.22%   +0.09%     
+ Complexity     1223     1199      -24     
============================================
  Files           140      140              
  Lines          7774     7789      +15     
  Branches        963      963              
============================================
+ Hits           3741     3756      +15     
  Misses         3701     3701              
  Partials        332      332              
Flag Coverage Δ
unit 36.59% <100.00%> (+0.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/12802454996

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/12802454996
Status: failure

@SujanSanjula96
Copy link
Contributor

The changes in the PR is related to a new component and not associated with the test failure. Hence, merging the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants