yaooqinn commented on code in PR #2675:
URL: https://github.com/apache/incubator-kyuubi/pull/2675#discussion_r874483503
##########
extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/PrivilegesBuilder.scala:
##########
@@ -447,16 +473,42 @@ object PrivilegesBuilder {
val table = getPlanField[TableIdentifier]("table")
inputObjs += tablePrivileges(table)
+ case "ShowTableProperties" =>
+ val resolvedTable = getPlanField[Any]("table")
+ val identifier = getFieldVal[AnyRef](resolvedTable, "identifier")
+ val namespace = invoke(identifier,
"namespace").asInstanceOf[Array[String]]
+ val table = invoke(identifier, "name").asInstanceOf[String]
+ inputObjs += PrivilegeObject(
+ TABLE_OR_VIEW,
+ PrivilegeObjectActionType.OTHER,
+ quote(namespace),
+ table,
+ Nil)
+
+ case "ShowCreateTable" =>
+ val resolvedTable = getPlanField[Any]("child")
+ val identifier = getFieldVal[AnyRef](resolvedTable, "identifier")
+ val namespace = invoke(identifier,
"namespace").asInstanceOf[Array[String]]
+ val table = invoke(identifier, "name").asInstanceOf[String]
+ inputObjs += PrivilegeObject(
+ TABLE_OR_VIEW,
+ PrivilegeObjectActionType.OTHER,
+ quote(namespace),
+ table,
+ Nil)
+
case "ShowFunctionsCommand" =>
- getPlanField[Option[String]]("db").foreach { db =>
- inputObjs += databasePrivileges(db)
- }
Review Comment:
using filtered command instead of this
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]