-
Notifications
You must be signed in to change notification settings - Fork 6
[NAE-2288] Delete of process retains global role from user #390
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
base: release/7.0.0-rev9
Are you sure you want to change the base?
Conversation
- added filter for global role
WalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Possibly related PRs
Suggested labels
Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| String defaultRealmCollection = collectionNameProvider.getDefaultRealmCollection(); | ||
| Pageable pageable = PageRequest.of(0, paginationProperties.getBackendPageSize()); | ||
| Collection<ProcessResourceId> roleIds = petriNetRoles.stream().map(ProcessRole::get_id).collect(Collectors.toSet()); | ||
| Collection<ProcessResourceId> roleIds = petriNetRoles.stream().filter(r -> !r.isGlobal()).map(ProcessRole::get_id).collect(Collectors.toSet()); |
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.
I'm a bit confused right now. The method PetriNetService.deletePetriNet calls:
userService.removeRoleOfDeletedPetriNetprocessRoleService.deleteRolesOfNet
The first method finds every ProcessRole, which is not a global and remove them from every user. The second method finds every ProcessRole (also global ones) and removes it: 1. from the every user (again), 2. from the repository
I'm confused because in the first method you don't remove global roles and in the second method you do the same removal, but you remove also global roles.
Can you explain me, please, how the removal works? I thought, that this fix will prevent removing global role from the database and from the users when removing petriNet
Description
Fixes NAE-2288
Dependencies
No new dependencies were introduced
Third party dependencies
Blocking Pull requests
There are no dependencies on other PR
How Has Been This Tested?
This was tested manually and with unit tests.
Test Configuration
Checklist:
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.