No need init password when auth disabled. (#12153)
This commit is contained in:
parent
47786e6c0b
commit
857e6113c4
@ -113,9 +113,16 @@ public class NacosAuthPluginService implements AuthPluginService {
|
|||||||
return ApplicationUtils.getBean(AuthConfigs.class).isAuthEnabled();
|
return ApplicationUtils.getBean(AuthConfigs.class).isAuthEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Only auth enabled and not global admin role existed.
|
||||||
|
*
|
||||||
|
* @return {@code true} when auth enabled and not global admin role existed, otherwise {@code false}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean isAdminRequest() {
|
public boolean isAdminRequest() {
|
||||||
return !ApplicationUtils.getBean(IAuthenticationManager.class).hasGlobalAdminRole();
|
boolean authEnabled = ApplicationUtils.getBean(AuthConfigs.class).isAuthEnabled();
|
||||||
|
boolean hasGlobalAdminRole = ApplicationUtils.getBean(IAuthenticationManager.class).hasGlobalAdminRole();
|
||||||
|
return authEnabled && !hasGlobalAdminRole;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void checkNacosAuthManager() {
|
protected void checkNacosAuthManager() {
|
||||||
|
Loading…
Reference in New Issue
Block a user