FANNG1 commented on code in PR #5682:
URL: https://github.com/apache/gravitino/pull/5682#discussion_r1895632191


##########
core/src/main/java/org/apache/gravitino/catalog/CredentialManager.java:
##########
@@ -38,16 +39,19 @@ public CredentialManager(
   }
 
   public List<Credential> getCredentials(NameIdentifier identifier) {
+    CredentialPrivilege privilege =
+        getCredentialPrivilege(PrincipalUtils.getCurrentUserName(), 
identifier);
     return doWithCatalog(
         NameIdentifierUtil.getCatalogIdentifier(identifier),
-        c -> getCredentials(c.catalog(), identifier),
+        catalogWrapper ->
+            catalogWrapper.doWithCredentialOps(
+                credentialOps -> credentialOps.getCredentials(identifier, 
privilege)),
         NoSuchCatalogException.class);
   }
 
-  private List<Credential> getCredentials(BaseCatalog catalog, NameIdentifier 
identifier) {
-    throw new NotImplementedException(
-        String.format(
-            "Load credentials is not implemented for catalog: %s, identifier: 
%s",
-            catalog.name(), identifier));
+  @SuppressWarnings("UnusedVariable")
+  private CredentialPrivilege getCredentialPrivilege(String user, 
NameIdentifier identifier)
+      throws NotAuthorizedException {
+    return CredentialPrivilege.WRITE;

Review Comment:
   As Gravitino doesn't provide the feature to check which privileges are 
granted to a user to a specific fileset, we provide a default WRITE privilege 
to make the access to fileset works well.



-- 
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: commits-unsubscr...@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to