private static void ensureGroupPermissionConsistency(DbSession dbSession, GroupPermissionDto dto) { if (dto.getGroupId() == null) { return; } GroupMapper groupMapper = dbSession.getMapper(GroupMapper.class); checkArgument( groupMapper.countGroupByOrganizationAndId(dto.getOrganizationUuid(), dto.getGroupId()) == 1, "Can't insert permission '%s' for group with id '%s' in organization with uuid '%s' because this group does not belong to organization with uuid '%s'", dto.getRole(), dto.getGroupId(), dto.getOrganizationUuid(), dto.getOrganizationUuid()); }
private static void ensureGroupPermissionConsistency(DbSession dbSession, GroupPermissionDto dto) { if (dto.getGroupId() == null) { return; } GroupMapper groupMapper = dbSession.getMapper(GroupMapper.class); checkArgument( groupMapper.countGroupByOrganizationAndId(dto.getOrganizationUuid(), dto.getGroupId()) == 1, "Can't insert permission '%s' for group with id '%s' in organization with uuid '%s' because this group does not belong to organization with uuid '%s'", dto.getRole(), dto.getGroupId(), dto.getOrganizationUuid(), dto.getOrganizationUuid()); }