在net.wendal.nutzbook.shiro.realm.SimpleAuthorizingRealm中
SimpleAuthorizationInfo auth = new SimpleAuthorizationInfo();
user = dao().fetchLinks(user, null);
if (user.getRoles() != null) {
dao().fetchLinks(user.getRoles(), null);
for (Role role : user.getRoles()) {
auth.addRole(role.getName());
if (role.getPermissions() != null) {
for (Permission p : role.getPermissions()) {
>> auth.addStringPermission(p.getName());
}
}
}
}
if (user.getPermissions() != null) {
for (Permission p : user.getPermissions()) {
>> auth.addStringPermission(p.getName());
}
}
return auth;
这两处功能是否已经重复了?
另外user --> role --> permission已经有对应关系,为什么还设计一个 user --> permission,的目的是什么呢?