Skip to content

Commit

Permalink
SHIBUI-1740
Browse files Browse the repository at this point in the history
migration path for existing user in systems
  • Loading branch information
chasegawa committed Jul 23, 2021
1 parent 85a3fd6 commit 6ee29be
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ public UserService(RoleRepository roleRepository, UserRepository userRepository)
@Override
@Transactional
public void afterPropertiesSet() {
// TODO: Ensure all the db users have a group - migration task
// SHIBUI-1740 migration task
userRepository.findAll().forEach(user -> {
if (user.getGroupId() == null) {
save(user); // this will ensure group is set as the default user group for those users without a group set
}
});
}

public boolean currentUserIsAdmin() {
Expand Down

0 comments on commit 6ee29be

Please sign in to comment.