abbccdda commented on a change in pull request #9103: URL: https://github.com/apache/kafka/pull/9103#discussion_r466714423
########## File path: core/src/main/scala/kafka/server/KafkaApis.scala ########## @@ -2982,12 +3089,33 @@ class KafkaApis(val requestChannel: RequestChannel, logIfDenied: Boolean = true, refCount: Int = 1): Boolean = { authorizer.forall { authZ => - val resource = new ResourcePattern(resourceType, resourceName, PatternType.LITERAL) - val actions = Collections.singletonList(new Action(operation, resource, refCount, logIfAllowed, logIfDenied)) - authZ.authorize(requestContext, actions).get(0) == AuthorizationResult.ALLOWED + if (authorizeAction(requestContext, operation, + resourceType, resourceName, logIfAllowed, logIfDenied, refCount, authZ)) { + true + } else { + operation match { + case ALTER | ALTER_CONFIGS | CREATE | DELETE => + requestContext.maybeFromControlPlane && + authorizeAction(requestContext, CLUSTER_ACTION, + resourceType, resourceName, logIfAllowed, logIfDenied, refCount, authZ) Review comment: Actually I think you are right, will change here. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org