Commit 70e9901c authored by michael.simon's avatar michael.simon
Browse files

Allow rest group creation with check for active groups only

parent 1caf996e
......@@ -25,6 +25,7 @@ import edu.kit.scc.webreg.dto.mapper.GroupEntityMapper;
import edu.kit.scc.webreg.entity.AdminUserEntity;
import edu.kit.scc.webreg.entity.EventType;
import edu.kit.scc.webreg.entity.GroupEntity;
import edu.kit.scc.webreg.entity.GroupStatus;
import edu.kit.scc.webreg.entity.LocalGroupEntity;
import edu.kit.scc.webreg.entity.RoleEntity;
import edu.kit.scc.webreg.entity.ServiceBasedGroupEntity;
......@@ -180,7 +181,7 @@ public class GroupDtoServiceImpl extends BaseDtoServiceImpl<GroupEntity, GroupEn
public GroupEntityDto create(String ssn, String name, Long userId) throws RestInterfaceException {
LocalGroupEntity entity = localGroupDao.findByName(name);
if (entity != null)
if ((entity != null) && (entity.getGroupStatus().equals(GroupStatus.ACTIVE)))
throw new GenericRestInterfaceException("group already exists");
ServiceEntity service = serviceDao.findByShortName(ssn);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment