yuqi1129 commented on code in PR #5023:
URL: https://github.com/apache/gravitino/pull/5023#discussion_r1777056482


##########
api/src/main/java/org/apache/gravitino/authorization/SupportsRoles.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.authorization;
+
+import org.apache.gravitino.annotation.Evolving;
+
+/**
+ * Interface for supporting list role names for objects. This interface will 
be mixed with metadata

Review Comment:
   be combined



##########
api/src/main/java/org/apache/gravitino/authorization/SupportsRoles.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.authorization;
+
+import org.apache.gravitino.annotation.Evolving;
+
+/**
+ * Interface for supporting list role names for objects. This interface will 
be mixed with metadata
+ * objects to provide listing role operations.
+ */
+@Evolving
+public interface SupportsRoles {
+
+  /**
+   * List all the role names associated with this metadata object. For the 
metalake metadata object,
+   * this method will only return the roles contains metalake object instead 
of all the roles in the
+   * metalake.

Review Comment:
   >  For the metalake metadata object,
      * this method will only return the roles contains metalake object instead 
of all the roles in the
      * metalake.
      
   Can you clarify it? I can't get the meaning.
      



##########
api/src/main/java/org/apache/gravitino/authorization/SupportsRoles.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.authorization;
+
+import org.apache.gravitino.annotation.Evolving;
+
+/**
+ * Interface for supporting list role names for objects. This interface will 
be mixed with metadata
+ * objects to provide listing role operations.
+ */
+@Evolving
+public interface SupportsRoles {
+
+  /**
+   * List all the role names associated with this metadata object. For the 
metalake metadata object,
+   * this method will only return the roles contains metalake object instead 
of all the roles in the
+   * metalake.
+   *
+   * @return The role name list associated with this metadata object.
+   */
+  String[] listBindingRoleNames();

Review Comment:
   Why not give it a default implementation and throw 
`UnsupportUnsupportedOperationException`?



##########
server/src/main/java/org/apache/gravitino/server/web/rest/MetadataObjectRoleOperations.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.server.web.rest;
+
+import com.codahale.metrics.annotation.ResponseMetered;
+import com.codahale.metrics.annotation.Timed;
+import java.util.Locale;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import org.apache.gravitino.GravitinoEnv;
+import org.apache.gravitino.MetadataObject;
+import org.apache.gravitino.MetadataObjects;
+import org.apache.gravitino.NameIdentifier;
+import org.apache.gravitino.authorization.AccessControlDispatcher;
+import org.apache.gravitino.dto.responses.NameListResponse;
+import org.apache.gravitino.lock.LockType;
+import org.apache.gravitino.lock.TreeLockUtils;
+import org.apache.gravitino.metrics.MetricNames;
+import org.apache.gravitino.server.authorization.NameBindings;
+import org.apache.gravitino.server.web.Utils;
+
[email protected]
+@Path("/metalakes/{metalake}/objects/{type}/{fullName}/roles")
+public class MetadataObjectRoleOperations {
+
+  private final AccessControlDispatcher accessControlManager;

Review Comment:
   accessControlManager -> accessControlDispatch?



-- 
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]

Reply via email to