AngersZhuuuu commented on code in PR #5581:
URL: https://github.com/apache/kyuubi/pull/5581#discussion_r1393641607
##########
extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/ranger/RangerSparkExtensionSuite.scala:
##########
@@ -1097,4 +1097,40 @@ class HiveCatalogRangerSparkExtensionSuite extends
RangerSparkExtensionSuite {
}
}
}
+
+ test("HadoopFsRelation") {
+ val db1 = defaultDb
+ val table1 = "table1"
+ withTempDir { path =>
+ withSingleCallEnabled {
+ withCleanTmpResources(Seq((s"$db1.$table1", "table"))) {
+ doAs(admin, sql(s"CREATE TABLE IF NOT EXISTS $db1.$table1 (id int,
scope int)"))
+ doAs(
+ admin,
+ sql(
+ s"""
+ |INSERT OVERWRITE DIRECTORY '$path'
+ |USING parquet
+ |SELECT * FROM $db1.$table1""".stripMargin))
+
+ interceptContains[AccessControlException](
+ doAs(
+ someone,
+ sql(
+ s"""
+ |INSERT OVERWRITE DIRECTORY '$path'
+ |USING parquet
+ |SELECT * FROM $db1.$table1""".stripMargin)))(
+ s"does not have [select] privilege on
[$db1/$table1/id,$db1/$table1/scope], " +
+ s"[update] privilege on [[$path, $path/]]")
+
+ doAs(admin, sql(s"SELECT * FROM
parquet.`$path`".stripMargin).explain(true))
+ interceptContains[AccessControlException](
+ doAs(someone, sql(s"SELECT * FROM
parquet.`$path`".stripMargin).explain(true)))(
+ s"does not have [select] privilege on " +
+ s"[[file:$path, file:$path/]]")
Review Comment:
> If so, still able to differ file:/abc, hdfs:/abc or s3:/abc?
Should do like this, but didn't found a best way yet
--
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]