Browse Source

Add dev profile annotations; delete authority USER from Admin test user

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.3-alpha
Pekka Helenius 4 years ago
parent
commit
7ff23e1a39
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      bookstore/src/main/java/com/fjordtek/bookstore/BookstoreApplication.java

+ 3
- 1
bookstore/src/main/java/com/fjordtek/bookstore/BookstoreApplication.java View File

@ -12,6 +12,7 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Profile;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.security.crypto.factory.PasswordEncoderFactories; import org.springframework.security.crypto.factory.PasswordEncoderFactories;
import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder;
@ -68,6 +69,7 @@ public class BookstoreApplication extends SpringBootServletInitializer {
} }
@Bean @Bean
@Profile("dev")
public CommandLineRunner userDatabaseRunner( public CommandLineRunner userDatabaseRunner(
UserRepository userRepository, UserRepository userRepository,
RoleRepository roleRepository, RoleRepository roleRepository,
@ -123,7 +125,6 @@ public class BookstoreApplication extends SpringBootServletInitializer {
// Add example roles for admin user // Add example roles for admin user
userRoleRepository.save(new UserRole(adminAU, adminAR)); userRoleRepository.save(new UserRole(adminAU, adminAR));
userRoleRepository.save(new UserRole(adminAU, salesAR)); userRoleRepository.save(new UserRole(adminAU, salesAR));
// userRoleRepository.save(new UserRole(adminAU, userAR));
// Add an example role for helpdesk user // Add an example role for helpdesk user
userRoleRepository.save(new UserRole(helpdeskAU, helpdeskAR)); userRoleRepository.save(new UserRole(helpdeskAU, helpdeskAR));
@ -152,6 +153,7 @@ public class BookstoreApplication extends SpringBootServletInitializer {
} }
@Bean @Bean
@Profile("dev")
public CommandLineRunner bookDatabaseRunner( public CommandLineRunner bookDatabaseRunner(
BookRepository bookRepository, BookRepository bookRepository,
BookHashRepository bookHashRepository, BookHashRepository bookHashRepository,


Loading…
Cancel
Save