You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ya...@apache.org on 2022/09/16 05:56:58 UTC

[incubator-kyuubi] branch master updated: [KYUUBI #3488] [Authz] Skip checking output view of CreateTempViewUsing

This is an automated email from the ASF dual-hosted git repository.

yao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 15fa49d39 [KYUUBI #3488] [Authz] Skip checking output view of CreateTempViewUsing
15fa49d39 is described below

commit 15fa49d39019155eb205890ddb708e19c95d78a1
Author: liangbowen <li...@gf.com.cn>
AuthorDate: Fri Sep 16 13:56:48 2022 +0800

    [KYUUBI #3488] [Authz] Skip checking output view of CreateTempViewUsing
    
    ### _Why are the changes needed?_
    
    close #3488 .
    
    ### _How was this patch tested?_
    - [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
    
    Closes #3495 from bowenliang123/3488-authz-createviewusing.
    
    Closes #3488
    
    63812cd3 [liangbowen] skip checking output view of CreateTempViewUsing
    
    Authored-by: liangbowen <li...@gf.com.cn>
    Signed-off-by: Kent Yao <ya...@apache.org>
---
 .../apache/kyuubi/plugin/spark/authz/PrivilegesBuilder.scala  |  1 -
 .../kyuubi/plugin/spark/authz/PrivilegesBuilderSuite.scala    | 11 +----------
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/PrivilegesBuilder.scala b/extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/PrivilegesBuilder.scala
index 2ec8fd7ca..d57cd2b0f 100644
--- a/extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/PrivilegesBuilder.scala
+++ b/extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/PrivilegesBuilder.scala
@@ -365,7 +365,6 @@ object PrivilegesBuilder {
         outputObjs += tablePrivileges(target)
 
       case "CreateTempViewUsing" =>
-        outputObjs += tablePrivileges(getTableIdent)
 
       case "DescribeColumnCommand" =>
         val table = getPlanField[TableIdentifier]("table")
diff --git a/extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/PrivilegesBuilderSuite.scala b/extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/PrivilegesBuilderSuite.scala
index 8ce092cac..5ed1a1905 100644
--- a/extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/PrivilegesBuilderSuite.scala
+++ b/extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/PrivilegesBuilderSuite.scala
@@ -664,16 +664,7 @@ abstract class PrivilegesBuilderSuite extends AnyFunSuite
     assert(operationType === CREATEVIEW)
     val tuple = PrivilegesBuilder.build(plan, spark)
     assert(tuple._1.size === 0)
-
-    assert(tuple._2.size === 1)
-    val po = tuple._2.head
-    assert(po.actionType === PrivilegeObjectActionType.OTHER)
-    assert(po.privilegeObjectType === PrivilegeObjectType.TABLE_OR_VIEW)
-    assert(po.dbname === null)
-    assert(po.objectName === "CreateTempViewUsing")
-    assert(po.columns.isEmpty)
-    val accessType = ranger.AccessType(po, operationType, isInput = false)
-    assert(accessType === AccessType.CREATE)
+    assert(tuple._2.size === 0)
   }
 
   test("DescribeColumnCommand") {