This repository was archived by the owner on Nov 17, 2023. It is now read-only.
[DLAB-1099]: Added a check while deleting a group; Delete group recor…#304
Merged
EpamBohdanHliva merged 3 commits intoapache:developfrom Sep 13, 2019
Merged
[DLAB-1099]: Added a check while deleting a group; Delete group recor…#304EpamBohdanHliva merged 3 commits intoapache:developfrom
EpamBohdanHliva merged 3 commits intoapache:developfrom
Conversation
Contributor
ofuks
commented
Sep 13, 2019
- Added a check while deleting a group;
- Delete group record from Project while deleting the group.
…d from Project while deleting group
EpamBohdanHliva
suggested changes
Sep 13, 2019
| @Override | ||
| public void removeGroup(String groupId) { | ||
| if (projectDAO.getProjectsWithStatusNotIn(ProjectDTO.Status.DELETED, ProjectDTO.Status.DELETING).stream() | ||
| .anyMatch(p -> p.getGroups().contains(groupId) && p.getGroups().size() == 1)) { |
Contributor
There was a problem hiding this comment.
It is better to forbid removing group if it is used in any of project (does not matter if p.getGroups().size() == 1)
Admin should go and remove such group manually from project
| throw new ResourceConflictException("Group can not be removed because it is used in some project"); | ||
| } | ||
|
|
||
| projectDAO.removeGroupInProjects(groupId); |
Contributor
There was a problem hiding this comment.
such method call not needed because admin should firstly remove group from project manually
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.