This commit is contained in:
parent
aaacc0bb0e
commit
f4cf28afba
@ -158,7 +158,7 @@ public class NacosRoleServiceImpl {
|
|||||||
|
|
||||||
public List<RoleInfo> getRoles(String username) {
|
public List<RoleInfo> getRoles(String username) {
|
||||||
List<RoleInfo> roleInfoList = roleInfoMap.get(username);
|
List<RoleInfo> roleInfoList = roleInfoMap.get(username);
|
||||||
if (!authConfigs.isCachingEnabled()) {
|
if (!authConfigs.isCachingEnabled() || roleInfoList == null) {
|
||||||
Page<RoleInfo> roleInfoPage = getRolesFromDatabase(username, DEFAULT_PAGE_NO, Integer.MAX_VALUE);
|
Page<RoleInfo> roleInfoPage = getRolesFromDatabase(username, DEFAULT_PAGE_NO, Integer.MAX_VALUE);
|
||||||
if (roleInfoPage != null) {
|
if (roleInfoPage != null) {
|
||||||
roleInfoList = roleInfoPage.getPageItems();
|
roleInfoList = roleInfoPage.getPageItems();
|
||||||
@ -177,7 +177,7 @@ public class NacosRoleServiceImpl {
|
|||||||
|
|
||||||
public List<PermissionInfo> getPermissions(String role) {
|
public List<PermissionInfo> getPermissions(String role) {
|
||||||
List<PermissionInfo> permissionInfoList = permissionInfoMap.get(role);
|
List<PermissionInfo> permissionInfoList = permissionInfoMap.get(role);
|
||||||
if (!authConfigs.isCachingEnabled()) {
|
if (!authConfigs.isCachingEnabled() || permissionInfoList == null) {
|
||||||
Page<PermissionInfo> permissionInfoPage = getPermissionsFromDatabase(role, DEFAULT_PAGE_NO, Integer.MAX_VALUE);
|
Page<PermissionInfo> permissionInfoPage = getPermissionsFromDatabase(role, DEFAULT_PAGE_NO, Integer.MAX_VALUE);
|
||||||
if (permissionInfoPage != null) {
|
if (permissionInfoPage != null) {
|
||||||
permissionInfoList = permissionInfoPage.getPageItems();
|
permissionInfoList = permissionInfoPage.getPageItems();
|
||||||
|
@ -91,7 +91,7 @@ public class NacosUserDetailsServiceImpl implements UserDetailsService {
|
|||||||
|
|
||||||
public User getUser(String username) {
|
public User getUser(String username) {
|
||||||
User user = userMap.get(username);
|
User user = userMap.get(username);
|
||||||
if (!authConfigs.isCachingEnabled()) {
|
if (!authConfigs.isCachingEnabled() || user == null) {
|
||||||
user = getUserFromDatabase(username);
|
user = getUserFromDatabase(username);
|
||||||
}
|
}
|
||||||
return user;
|
return user;
|
||||||
|
Loading…
Reference in New Issue
Block a user