public class RoleDataInitializer extends Object implements DataInitializer
These roles are necessary for seed data we define within this service. However, the admin user service also may define some of this same data for itself and will synchronize it over to this service. To avoid creation of duplicate records, the IDs used here should be kept in sync with whatever the admin user service seed data defines.
Modifier and Type | Class and Description |
---|---|
static class |
RoleDataInitializer.UserRoleIds |
Constructor and Description |
---|
RoleDataInitializer(com.broadleafcommerce.common.extension.TypeFactory typeFactory,
RoleRepository<JpaUserRole> roleRepository,
UserPermissionRepository<JpaUserPermission> userPermissionRepository) |
Modifier and Type | Method and Description |
---|---|
protected void |
createCustomerUserRole()
Creates the role for the anonymous or authenticated customer user.
|
protected void |
createRoleIfMissing(String id,
String name,
Collection<String> permissionIds) |
void |
initialize()
Initialize seed data for the application.
|
public RoleDataInitializer(com.broadleafcommerce.common.extension.TypeFactory typeFactory, RoleRepository<JpaUserRole> roleRepository, UserPermissionRepository<JpaUserPermission> userPermissionRepository)
@Transactional public void initialize()
DataInitializer
initialize
in interface DataInitializer
protected void createCustomerUserRole()
protected void createRoleIfMissing(String id, String name, Collection<String> permissionIds)
Copyright © 2021. All rights reserved.