use of cn.dubidubi.model.base.PermissionDO in project dubidubi by lzzzz4.
the class LoginRealm method doGetAuthorizationInfo.
// 授权
@Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
UserDO userDO = (UserDO) principals.getPrimaryPrincipal();
Integer roleId = userLoginService.getRoleIdByUserId(userDO.getId());
if (roleId == null) {
return null;
}
List<PermissionDO> list = userLoginService.listPermissionByRoleId(roleId);
int length = list.size();
SimpleAuthorizationInfo simpleAuthorizationInfo = new SimpleAuthorizationInfo();
for (int i = 0; i < length; i++) {
String temp = list.get(i).getEnabled();
if (temp.equals("Y")) {
simpleAuthorizationInfo.addStringPermission(list.get(i).getRemark());
}
}
return simpleAuthorizationInfo;
}
Aggregations