小编Rob*_*ter的帖子

使用Thymeleaf检查特定的Stormpath组成员身份

我正在尝试确定登录用户是否是特定Stormpath组的成员.

以下工作,但它基于错误的属性(groups.href)

<div th:text="${#lists.contains(account.groups.href, 'https://api.stormpath.com/v1/accounts/eXaMpLe12345/groups')}" />
Run Code Online (Sandbox Code Playgroud)

而我试图找到(伪代码) groups.isMemberOf('https://api.stormpath.com/v1/accounts/mYgRrOuP1234/groups')

我知道如何遍历组并打印出所有数据,我可以看到我想要找到的组的href,但我不知道如何通过它的href访问它.

<div th:if="${account.groups != null}">
    <ul>
       <li th:each="group : ${account.groups}" th:text="${group.href}">group details...</li>
    </ul>
</div>
Run Code Online (Sandbox Code Playgroud)

thymeleaf spring-boot stormpath

3
推荐指数
1
解决办法
107
查看次数

标签 统计

spring-boot ×1

stormpath ×1

thymeleaf ×1