use of org.apache.shiro.mgt.RealmSecurityManager in project shiro by apache.
the class IniSecurityManagerFactory method isAutoApplyRealms.
protected boolean isAutoApplyRealms(SecurityManager securityManager) {
boolean autoApply = true;
if (securityManager instanceof RealmSecurityManager) {
// only apply realms if they haven't been explicitly set by the user:
RealmSecurityManager realmSecurityManager = (RealmSecurityManager) securityManager;
Collection<Realm> realms = realmSecurityManager.getRealms();
if (!CollectionUtils.isEmpty(realms)) {
log.info("Realms have been explicitly set on the SecurityManager instance - auto-setting of " + "realms will not occur.");
autoApply = false;
}
}
return autoApply;
}
Aggregations