我想检查当前用户是否设置了属性,如下所示:
#if(!${context.identity.claims.get("custom:organisation")})
... Do stuff
#end
我尝试了以下方法:
#if (${context.identity.claims["custom:organisation"]})
#if (${context.identity["custom:organisation"]})
#if ($context.identity.claims["custom:organisation"])
#if ($util.isNull($context.identity.claims["custom:organisation"]))
答案 0 :(得分:0)
您应该能够在声明地图上使用containsKey,如下所示:
#if($context.identity.claims.containsKey("custom:organisation"))
... Do stuff
#end