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

peacewong pushed a commit to branch dev-1.3.2
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git


The following commit(s) were added to refs/heads/dev-1.3.2 by this push:
     new 2979079c2 fix incorrect admin (#4000)
2979079c2 is described below

commit 2979079c27df240d87254cfb1a06c6811e242579
Author: GuoPhilipse <[email protected]>
AuthorDate: Wed Dec 14 19:40:44 2022 +0800

    fix incorrect admin (#4000)
---
 .../apache/linkis/common/conf/Configuration.scala  |  2 +-
 .../linkis/common/conf/ConfigurationTest.scala     | 29 ++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git 
a/linkis-commons/linkis-common/src/main/scala/org/apache/linkis/common/conf/Configuration.scala
 
b/linkis-commons/linkis-common/src/main/scala/org/apache/linkis/common/conf/Configuration.scala
index bc51ab5fb..b10a94423 100644
--- 
a/linkis-commons/linkis-common/src/main/scala/org/apache/linkis/common/conf/Configuration.scala
+++ 
b/linkis-commons/linkis-common/src/main/scala/org/apache/linkis/common/conf/Configuration.scala
@@ -61,7 +61,7 @@ object Configuration extends Logging {
   private val adminUsers = GOVERNANCE_STATION_ADMIN.getValue.split(",")
 
   def isAdmin(username: String): Boolean = {
-    adminUsers.exists(username.equalsIgnoreCase)
+    adminUsers.exists(username.equals)
   }
 
   def getGateWayURL(): String = {
diff --git 
a/linkis-commons/linkis-common/src/test/scala/org/apache/linkis/common/conf/ConfigurationTest.scala
 
b/linkis-commons/linkis-common/src/test/scala/org/apache/linkis/common/conf/ConfigurationTest.scala
new file mode 100644
index 000000000..5eead07f4
--- /dev/null
+++ 
b/linkis-commons/linkis-common/src/test/scala/org/apache/linkis/common/conf/ConfigurationTest.scala
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.common.conf
+
+import org.junit.jupiter.api.{Assertions, Test}
+
+class ConfigurationTest {
+
+  @Test private[conf] def testIsAdmin(): Unit = {
+    Assertions.assertTrue(Configuration.isAdmin("hadoop"))
+    Assertions.assertFalse(Configuration.isAdmin("HaDoop"))
+  }
+
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to