bowenliang123 commented on code in PR #5645:
URL: https://github.com/apache/kyuubi/pull/5645#discussion_r1387496425
##########
extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/ranger/RangerSparkExtensionSuite.scala:
##########
@@ -1172,4 +1173,29 @@ class HiveCatalogRangerSparkExtensionSuite extends
RangerSparkExtensionSuite {
}
}
}
+
+ test("CreateDatabaseCommand/AlterDatabaseSetLocationCommand") {
+ val db1 = "db1"
+ withSingleCallEnabled {
+ withTempDir { path1 =>
+ withTempDir { path2 =>
+ withCleanTmpResources(Seq((s"$db1", "database"))) {
+ interceptContains[AccessControlException](
+ doAs(someone, sql(s"CREATE DATABASE $db1 LOCATION '$path1'")))(
+ s"does not have [create] privilege on [$db1], " +
+ s"[write] privilege on [[$path1, $path1/]]")
+ doAs(admin, sql(s"CREATE DATABASE $db1 LOCATION '$path1'"))
+ interceptContains[AccessControlException](
+ doAs(someone, sql(s"ALTER DATABASE $db1 SET LOCATION
'$path2'")))(
+ s"does not have [alter] privilege on [$db1], " +
+ s"[write] privilege on [[$path2, $path2/]]")
Review Comment:
There is a case should be also tested , for the user have alter privilege of
the table but lack of write privilege of the location path.
This should reflect the possible impact to the exited user of authz plugin.
@AngersZhuuuu @yaooqinn
--
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]