bharos commented on code in PR #8857:
URL: https://github.com/apache/gravitino/pull/8857#discussion_r2449382798
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/dispatcher/IcebergTableOperationExecutor.java:
##########
@@ -29,9 +33,14 @@
import org.apache.iceberg.rest.responses.ListTablesResponse;
import org.apache.iceberg.rest.responses.LoadCredentialsResponse;
import org.apache.iceberg.rest.responses.LoadTableResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class IcebergTableOperationExecutor implements
IcebergTableOperationDispatcher {
+ private static final Logger LOG =
LoggerFactory.getLogger(IcebergTableOperationExecutor.class);
+ private static final String OWNER_PROPERTY = "owner";
Review Comment:
Done
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/dispatcher/IcebergTableOperationExecutor.java:
##########
@@ -41,6 +50,34 @@ public
IcebergTableOperationExecutor(IcebergCatalogWrapperManager icebergCatalog
@Override
public LoadTableResponse createTable(
IcebergRequestContext context, Namespace namespace, CreateTableRequest
createTableRequest) {
+ String authenticatedUser = context.userName();
+ if (StringUtils.isNotBlank(authenticatedUser)
+ && !AuthConstants.ANONYMOUS_USER.equals(authenticatedUser)) {
+ String existingOwner =
createTableRequest.properties().get(OWNER_PROPERTY);
+
+ // Updated the owner as the authenticated user, if owner missing or
different from
+ // authenticated user
+ if (existingOwner == null || !existingOwner.equals(authenticatedUser)) {
Review Comment:
Done
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]