2

shiro.ini我声明以下 SQL 查询:

jdbcRealm.authenticationQuery = SELECT password FROM Person WHERE email = ?
jdbcRealm.userRolesQuery = SELECT id FROM SecurityRole WHERE id = (SELECT securityRole_id FROM Person WHERE email = ?)
jdbcRealm.permissionsQuery = SELECT action FROM SecurityPermission WHERE id = (SELECT permissions_id FROM securityrole_securitypermission WHERE securityrole_id = ?)

当我用 在数据库上运行它替换最后?一个查询中的1 有=“休息:*”。1rest:*
SecurityUtils.getSubject().isPermitted(new WildcardPermission("rest"));falsesecurityrole_securitypermissionsecuritypermissionaction

在此处输入图像描述

4

1 回答 1

3

jdbcRealm.permissionsLookupEnabled = true做了这项工作。;)

于 2013-10-09T17:45:09.963 回答