Ignore Bot on Domain restriction (#19032)

(cherry picked from commit b01707e54df153208a65f168244331d74513e1d6)
This commit is contained in:
Mohit Yadav 2024-12-12 19:23:24 +05:30 committed by mohitdeuex
parent 319c68189c
commit e28d0f934a

View File

@ -688,7 +688,9 @@ public final class EntityUtil {
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()));