minor registration cleanup work
This commit is contained in:
parent
721eda402a
commit
c4def2db3f
@ -18,9 +18,9 @@ import org.springframework.stereotype.Component;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class InitialDataLoader implements ApplicationListener<ContextRefreshedEvent> {
|
public class SetupDataLoader implements ApplicationListener<ContextRefreshedEvent> {
|
||||||
|
|
||||||
boolean alreadySetup = false;
|
private boolean alreadySetup = false;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserRepository userRepository;
|
private UserRepository userRepository;
|
||||||
@ -34,11 +34,14 @@ public class InitialDataLoader implements ApplicationListener<ContextRefreshedEv
|
|||||||
@Autowired
|
@Autowired
|
||||||
private PasswordEncoder passwordEncoder;
|
private PasswordEncoder passwordEncoder;
|
||||||
|
|
||||||
|
// API
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void onApplicationEvent(final ContextRefreshedEvent event) {
|
public void onApplicationEvent(final ContextRefreshedEvent event) {
|
||||||
if (alreadySetup)
|
if (alreadySetup) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// == create initial privileges
|
// == create initial privileges
|
||||||
final Privilege readPrivilege = createPrivilegeIfNotFound("READ_PRIVILEGE");
|
final Privilege readPrivilege = createPrivilegeIfNotFound("READ_PRIVILEGE");
|
Loading…
x
Reference in New Issue
Block a user