Class AuthDataInitializer
java.lang.Object
hu.rts.mike.example.dev.crm.security.AuthDataInitializer
- All Implemented Interfaces:
EventListener,org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
@Component
public class AuthDataInitializer
extends Object
implements org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected final AuthInfoRepositoryprivate final org.springframework.security.crypto.password.PasswordEncoderprotected final RoleRepositoryprotected final UserInfoRepository -
Constructor Summary
ConstructorsConstructorDescriptionAuthDataInitializer(AuthInfoRepository authInfoRepository, UserInfoRepository userInfoRepository, RoleRepository roleRepository, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder) -
Method Summary
Modifier and TypeMethodDescriptioncreateAuthAndUserInfoIfNotFound(String name, String displayName, Set<Role> roles) createRoleIfNotFound(String name, Set<Privilege> privileges) voidonApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Field Details
-
alreadyInitialized
protected boolean alreadyInitialized -
authInfoRepository
-
userInfoRepository
-
roleRepository
-
passwordEncoder
private final org.springframework.security.crypto.password.PasswordEncoder passwordEncoder
-
-
Constructor Details
-
AuthDataInitializer
public AuthDataInitializer(AuthInfoRepository authInfoRepository, UserInfoRepository userInfoRepository, RoleRepository roleRepository, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder)
-
-
Method Details
-
createRoleIfNotFound
-
createAuthAndUserInfoIfNotFound
-
onApplicationEvent
public void onApplicationEvent(@NonNull org.springframework.context.event.ContextRefreshedEvent event) - Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
-