24
24
import com .provectus .kafka .ui .model .rbac .permission .TopicAction ;
25
25
import com .provectus .kafka .ui .service .DeserializationService ;
26
26
import com .provectus .kafka .ui .service .MessagesService ;
27
+ import com .provectus .kafka .ui .util .DynamicConfigOperations ;
27
28
import java .util .List ;
28
29
import java .util .Map ;
29
30
import java .util .Optional ;
30
31
import javax .annotation .Nullable ;
31
32
import javax .validation .Valid ;
32
33
import lombok .RequiredArgsConstructor ;
33
34
import lombok .extern .slf4j .Slf4j ;
35
+ import org .apache .commons .lang3 .StringUtils ;
34
36
import org .apache .commons .lang3 .tuple .Pair ;
35
37
import org .apache .kafka .common .TopicPartition ;
36
38
import org .springframework .http .ResponseEntity ;
@@ -47,6 +49,7 @@ public class MessagesController extends AbstractController implements MessagesAp
47
49
48
50
private final MessagesService messagesService ;
49
51
private final DeserializationService deserializationService ;
52
+ private final DynamicConfigOperations dynamicConfigOperations ;
50
53
51
54
@ Override
52
55
public Mono <ResponseEntity <Void >> deleteTopicMessages (
@@ -94,6 +97,10 @@ public Mono<ResponseEntity<Flux<TopicMessageEventDTO>>> getTopicMessages(String
94
97
.topicActions (MESSAGES_READ )
95
98
.operationName ("getTopicMessages" );
96
99
100
+ if (StringUtils .isNoneEmpty (q ) && MessageFilterTypeDTO .GROOVY_SCRIPT == filterQueryType ) {
101
+ dynamicConfigOperations .checkIfFilteringGroovyEnabled ();
102
+ }
103
+
97
104
if (auditService .isAuditTopic (getCluster (clusterName ), topicName )) {
98
105
contextBuilder .auditActions (AuditAction .VIEW );
99
106
}
0 commit comments