Minor: skip domain check for bots and admin (#18734)

This commit is contained in:
Sriharsha Chintalapani 2024-11-22 10:41:42 -08:00 committed by GitHub
parent 532efbe5ab
commit 04659132b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -84,7 +84,9 @@ public class PolicyEvaluator {
@NonNull ResourceContextInterface resourceContext,
OperationContext operationContext) {
// If the Resource Does not belong to any Domain, then evaluate via other permissions
if (!nullOrEmpty(resourceContext.getDomain())) {
if (!nullOrEmpty(resourceContext.getDomain())
&& !subjectContext.isAdmin()
&& !subjectContext.isBot()) {
EntityReference domain = resourceContext.getDomain();
if (!subjectContext.hasDomain(domain)) {
throw new AuthorizationException(