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

Refactor unshare organization users logic to support specific user unsharing for shared organizations #424

Conversation

BimsaraBodaragama
Copy link
Contributor

@BimsaraBodaragama BimsaraBodaragama commented Jan 16, 2025

Purpose

Enhance the user unsharing logic to provide specific unsharing capabilities for shared organizations.

Goals

  • Introduce a new method to unshare a specific user from a shared organization.
  • Refactor the existing unsharing logic to be more modular and reusable.
  • Improve code clarity and maintainability by introducing a dedicated removeSharedUsers method.

Approach

  • Added a new default method unshareOrganizationUserInSharedOrganization in the interface to handle specific user unsharing.
  • Updated the unshareOrganizationUsers method to use the modular removeSharedUsers utility method.
  • Introduced logic to handle user unsharing restrictions based on editRestriction and userResidentOrganizationId.
  • Ensured proper exception handling for user store operations.
  • Maintained backward compatibility with existing unshare operations.

Related Issue

Resolves: Enhance User Unsharing Logic to Support Specific Shared Organization Scenarios #22272

Copy link

codecov bot commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.29%. Comparing base (46fed85) to head (8a42e53).
Report is 4 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #424      +/-   ##
============================================
+ Coverage     46.70%   48.29%   +1.58%     
- Complexity     1196     1199       +3     
============================================
  Files           140      140              
  Lines          7808     7778      -30     
  Branches        968      962       -6     
============================================
+ Hits           3647     3756     +109     
+ Misses         3829     3691     -138     
+ Partials        332      331       -1     
Flag Coverage Δ
unit 36.59% <ø> (+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/12820472949

@jenkins-is-staging
Copy link

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

@jenkins-is-staging
Copy link

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

@jenkins-is-staging
Copy link

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

Copy link

@jenkins-is-staging jenkins-is-staging left a 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/12822711511

@SujanSanjula96 SujanSanjula96 merged commit 842f79c into wso2-extensions:main Jan 17, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance User Unsharing Logic to Support Specific Shared Organization Scenarios
3 participants