Github user tgravescs commented on a diff in the pull request:
https://github.com/apache/spark/pull/12760#discussion_r61925009
--- Diff: core/src/test/scala/org/apache/spark/SecurityManagerSuite.scala
---
@@ -60,6 +110,43 @@ class SecurityManagerSuite extends SparkFunSuite with
ResetSystemProperties {
assert(securityManager.checkUIViewPermissions(null) === true)
}
+ test("set security with api for groups") {
+ val conf = new SparkConf
+ conf.set("spark.user.groups.mapping",
"org.apache.spark.DummyGroupMappingServiceProvider")
+
+ val securityManager = new SecurityManager(conf);
+ securityManager.setAcls(true)
+ securityManager.setViewAclsGroups("group1,group2")
+
+ // group1,group2 match
+ assert(securityManager.checkUIViewPermissions("user1") === true)
+ assert(securityManager.checkUIViewPermissions("user2") === true)
+
+ // change groups so they do not match
+ securityManager.setViewAclsGroups("group4,group5")
+ assert(securityManager.checkUIViewPermissions("user1") === false)
+ assert(securityManager.checkUIViewPermissions("user2") === false)
+
+
+ val conf2 = new SparkConf
+ conf.set("spark.user.groups.mapping", "BogusServiceProvider")
--- End diff --
I don't think we need this section of tests, we already test
BogusServiceProvider in the test above. One is enough.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]