|
@@ -74,8 +74,16 @@ public class ShiroRealm extends AuthorizingRealm {
|
|
|
}
|
|
}
|
|
|
SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
|
|
SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
|
|
|
|
|
|
|
|
- // 设置用户拥有的角色集合,比如“admin,test”
|
|
|
|
|
- Set<String> roleSet = commonApi.queryUserRolesById(userId);
|
|
|
|
|
|
|
+ // 小程序/SSO用户(username以personal_或enterprise_开头)无需RBAC权限校验,授予通配权限
|
|
|
|
|
+ // 这类用户不是后台管理系统用户,只要能看到的页面,其背后接口都应允许调用
|
|
|
|
|
+ if (username != null && (username.startsWith("personal_") || username.startsWith("enterprise_"))) {
|
|
|
|
|
+ info.addStringPermission("*");
|
|
|
|
|
+ log.debug("===============小程序/SSO用户[{}]授予通配权限==============", username);
|
|
|
|
|
+ return info;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 设置用户拥有的角色集合,比如"admin,test"
|
|
|
|
|
+ Set<String> roleSet = commonApi.queryUserRolesById(userId);
|
|
|
//System.out.println(roleSet.toString());
|
|
//System.out.println(roleSet.toString());
|
|
|
info.setRoles(roleSet);
|
|
info.setRoles(roleSet);
|
|
|
|
|
|