diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/policies/PolicyResource.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/policies/PolicyResource.java index dbe8a61bb34..fd839cc65ba 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/policies/PolicyResource.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/policies/PolicyResource.java @@ -67,6 +67,7 @@ import org.openmetadata.service.resources.CollectionRegistry; import org.openmetadata.service.resources.EntityResource; import org.openmetadata.service.security.Authorizer; import org.openmetadata.service.security.policyevaluator.CompiledRule; +import org.openmetadata.service.security.policyevaluator.OperationContext; import org.openmetadata.service.security.policyevaluator.RuleEvaluator; import org.openmetadata.service.util.JsonUtils; import org.openmetadata.service.util.ResultList; @@ -550,7 +551,9 @@ public class PolicyResource extends EntityResource { @Parameter(description = "Expression of validating rule", schema = @Schema(type = "string")) @PathParam("expression") String expression) { - authorizer.authorizeAdmin(securityContext); + OperationContext operationContext = + new OperationContext(entityType, MetadataOperation.EDIT_ALL); + authorizer.authorize(securityContext, operationContext, getResourceContext()); CompiledRule.validateExpression(expression, Boolean.class); } }