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 Permission Validation for Hybrid User Role Deletion #6303

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

BimsaraBodaragama
Copy link
Member

Proposed changes in this pull request

  • Added getPermittedUserNamesToBeDeleted to validate and retrieve user names allowed for deletion based on role and organizational restrictions.
  • Implemented dynamic SQL queries to handle restricted and unrestricted user deletion permissions.
  • Integrated permission checks into the hybrid user role deletion process to ensure only authorized users are deleted.

When should this PR be merged

  • This PR can be merged after a review and successful validation of the changes.

Follow up actions

  • Validate the functionality in relevant test scenarios to ensure correct behavior. (Can verify with the user sharing feature)

Related Issue

Add Permission Validation for Hybrid User Role Deletion

Copy link

codecov bot commented Jan 19, 2025

Codecov Report

Attention: Patch coverage is 37.50000% with 55 lines in your changes missing coverage. Please review.

Project coverage is 46.42%. Comparing base (368134f) to head (a6c313d).
Report is 75 commits behind head on master.

Files with missing lines Patch % Lines
...bon/identity/role/v2/mgt/core/dao/RoleDAOImpl.java 45.83% 39 Missing ⚠️
...ty/role/v2/mgt/core/RoleManagementServiceImpl.java 0.00% 15 Missing ⚠️
.../carbon/identity/role/v2/mgt/core/dao/RoleDAO.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6303      +/-   ##
============================================
+ Coverage     45.91%   46.42%   +0.51%     
- Complexity    14481    14740     +259     
============================================
  Files          1672     1677       +5     
  Lines        103141   104055     +914     
  Branches      18010    18316     +306     
============================================
+ Hits          47360    48311     +951     
+ Misses        48970    48863     -107     
- Partials       6811     6881      +70     
Flag Coverage Δ
unit 29.59% <37.50%> (+0.42%) ⬆️

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.

@BimsaraBodaragama
Copy link
Member Author

[Quality Gate failed]
This error comes from code duplication in the RoleManegementService and RoleDAO since they share the same code. Yet, this is not only because of my new code but also because of the overall.

@BimsaraBodaragama BimsaraBodaragama self-assigned this Jan 20, 2025
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.

4 participants