You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@dlab.apache.org by GitBox <gi...@apache.org> on 2019/09/13 13:29:35 UTC

[GitHub] [incubator-dlab] bhliva commented on a change in pull request #304: [DLAB-1099]: Added a check while deleting a group; Delete group recor…

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org