Package io.jmix.securitydata.impl.role
Class RoleCodeUniquenessValidator
java.lang.Object
io.jmix.securitydata.impl.role.RoleCodeUniquenessValidator
- All Implemented Interfaces:
org.springframework.beans.factory.SmartInitializingSingleton
@Component("sec_RoleCodeUniquenessValidator")
public class RoleCodeUniquenessValidator
extends Object
implements org.springframework.beans.factory.SmartInitializingSingleton
Fails application startup if a design-time (annotated) role shares its
code
with a runtime (database) role of the same type. Resource and row-level roles are
checked independently, since they are separate code namespaces.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ResourceRoleRepositoryprotected final RowLevelRoleRepository -
Constructor Summary
ConstructorsConstructorDescriptionRoleCodeUniquenessValidator(ResourceRoleRepository resourceRoleRepository, RowLevelRoleRepository rowLevelRoleRepository) -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidcheckTypeUniqueness(Collection<? extends BaseRole> roles, String roleType) voidvalidate()
-
Field Details
-
resourceRoleRepository
-
rowLevelRoleRepository
-
-
Constructor Details
-
RoleCodeUniquenessValidator
public RoleCodeUniquenessValidator(ResourceRoleRepository resourceRoleRepository, RowLevelRoleRepository rowLevelRoleRepository)
-
-
Method Details
-
afterSingletonsInstantiated
public void afterSingletonsInstantiated()- Specified by:
afterSingletonsInstantiatedin interfaceorg.springframework.beans.factory.SmartInitializingSingleton
-
validate
public void validate() -
checkTypeUniqueness
-