Skip to content

Commit

Permalink
SHIBUI-1031: 1034
Browse files Browse the repository at this point in the history
  • Loading branch information
dima767 committed Dec 11, 2018
1 parent 2a6bf14 commit 656bab1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,27 @@ class DevConfig {

@Transactional
@PostConstruct
void createDevAdminUsers() {
void createDevUsers() {
if (adminUserRepository.count() == 0) {
def user = new User().with {
def users = [new User().with {
username = 'admin'
password = '{noop}adminpass'
name = 'Joe the admin'
emailAddress = 'joe@institution.edu'
roles.add(new Role(name: 'ROLE_ADMIN'))
it
}, new User().with {
username = 'nonadmin'
password = '{noop}nonadminpass'
name = 'Peter non admin'
emailAddress = 'peter@institution.edu'
roles.add(new Role(name: 'ROLE_USER'))
it
}]
users.each {
adminUserRepository.save(it)
}

adminUserRepository.save(user)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public class User extends AbstractAuditable {
@Column(nullable = false)
private String password;

private String firstName;
private String name;

private String lastName;
private String emailAddress;

//Ignore properties annotation here is to prevent stack overflow recursive error during JSON serialization
@JsonIgnoreProperties("users")
Expand Down

0 comments on commit 656bab1

Please sign in to comment.