bhliva commented on a change in pull request #304: [DLAB-1099]: Added a check 
while deleting a group; Delete group recor…
URL: https://github.com/apache/incubator-dlab/pull/304#discussion_r324192879
 
 

 ##########
 File path: 
services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/UserGroupServiceImpl.java
 ##########
 @@ -83,6 +88,12 @@ public void removeGroupFromRole(Set<String> groups, 
Set<String> roleIds) {
 
        @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)) {
 
 Review 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

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to