Grails:Spring Security Core - 如何按默认配置按帐户/用户排序

时间:2017-05-31 07:13:47

标签: grails spring-security

我目前正在解决使用Spring Security Core进行排序的问题。我按角色列出用户,并且推荐的设置将需要更多代码。使用Spring Security Core / Shiro对Account / User属性进行排序的最佳途径是什么?

这就是我目前填写列表并计算的方式。

def accountRoles = AccountRole.findAllByRole(role, [max: max, offset: offset])
def accountInstanceTotal = AccountRole.countByRole(role)
def accountInstanceList = accountRoles.collect(){ it.account }

帐户

Set<Role> getAuthorities() {
    AccountRole.findAllByAccount(this)*.role
}

默认配置没有hasMany关系来按帐户/用户上的角色查找。

任何指导都将非常感谢。在此先感谢您的帮助。

0 个答案:

没有答案