Skip to content

Commit

Permalink
[nojira]
Browse files Browse the repository at this point in the history
update bootstrap for email
  • Loading branch information
jj committed Jan 22, 2019
1 parent 1ecda3f commit db2e8e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ class UserBootstrap {
if (shibUIConfiguration.userBootstrapResource) {
log.info("configuring users from ${shibUIConfiguration.userBootstrapResource.URI}")
new CSVReader(new InputStreamReader(shibUIConfiguration.userBootstrapResource.inputStream)).each { it ->
def (username, password, firstName, lastName, roleName) = it
def (username, password, firstName, lastName, roleName, email) = it
def role = roleRepository.findByName(roleName).orElse(new Role(name: roleName))
roleRepository.saveAndFlush(role)
def user = userRepository.findByUsername(username).orElse(new User(username: username)).with {
it.password = password
it.firstName = firstName
it.lastName = lastName
it.roles.add(role)
it.emailAddress = email
it
}
userRepository.saveAndFlush(user)
Expand Down
4 changes: 2 additions & 2 deletions backend/src/test/resources/conf/1044.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"user1","password1","firstName1","lastName1","ROLE_ADMIN"
"user2","password2","firstName2","lastName2","ROLE_USER"
"user1","password1","firstName1","lastName1","ROLE_ADMIN","user1@example.org"
"user2","password2","firstName2","lastName2","ROLE_USER","user2@example.org"

0 comments on commit db2e8e0

Please sign in to comment.