From e28d0f934ab7cded215e79cdd44ea44b5fed2a6b Mon Sep 17 00:00:00 2001 From: Mohit Yadav <105265192+mohityadav766@users.noreply.github.com> Date: Thu, 12 Dec 2024 19:23:24 +0530 Subject: [PATCH] Ignore Bot on Domain restriction (#19032) (cherry picked from commit b01707e54df153208a65f168244331d74513e1d6) --- .../main/java/org/openmetadata/service/util/EntityUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/util/EntityUtil.java b/openmetadata-service/src/main/java/org/openmetadata/service/util/EntityUtil.java index 9a962b3ee7f1..3591eed3a8eb 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/util/EntityUtil.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/util/EntityUtil.java @@ -688,7 +688,9 @@ public static void addDomainQueryParam( SubjectContext subjectContext = getSubjectContext(securityContext); // If the User is admin then no need to add domainId in the query param // Also if there are domain restriction on the subject context via role - if (!subjectContext.isAdmin() && subjectContext.hasAnyRole(DOMAIN_ONLY_ACCESS_ROLE)) { + if (!subjectContext.isAdmin() + && !subjectContext.isBot() + && subjectContext.hasAnyRole(DOMAIN_ONLY_ACCESS_ROLE)) { if (!nullOrEmpty(subjectContext.getUserDomains())) { filter.addQueryParam( "domainId", getCommaSeparatedIdsFromRefs(subjectContext.getUserDomains()));