You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/11/15 00:49:56 UTC

[GitHub] tysonnorris commented on a change in pull request #4114: Update KindRestrictor to merge namespace and default whitelists

tysonnorris commented on a change in pull request #4114: Update KindRestrictor to merge namespace and default whitelists
URL: https://github.com/apache/incubator-openwhisk/pull/4114#discussion_r233677573
 
 

 ##########
 File path: core/controller/src/main/scala/org/apache/openwhisk/core/entitlement/KindRestrictor.scala
 ##########
 @@ -46,10 +46,8 @@ case class KindRestrictor(whitelist: Option[Set[String]] = None)(implicit loggin
     })(TransactionId.controller)
 
   def check(user: Identity, kind: String): Boolean = {
-    user.limits.allowedKinds
-      .orElse(whitelist)
-      .map(allowed => allowed.contains(kind))
-      .getOrElse(true)
+    val kindList = user.limits.allowedKinds.getOrElse(Set()).union(whitelist.getOrElse(Set()))
 
 Review comment:
   use `Set.empty` instead of `Set()`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services