Akeneo\UserManagement\Component\Model\User:
    constraints:
        - Akeneo\UserManagement\Bundle\Validator\Constraints\CreateUser: ~
        - Akeneo\UserManagement\Bundle\Validator\Constraints\UserPreferences:
            groups: [User]
        - Akeneo\UserManagement\Bundle\Validator\Constraints\UserOwnsDefaultGridViews: ~
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: username
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: email
    properties:
        username:
            - NotBlank:     ~
            - Length:
                min:        3
                max:        255
            - Akeneo\UserManagement\Bundle\Validator\Constraints\ValueShouldNotContainsBlacklistedCharacters: ~
        password:
            - NotBlank:     ~
        email:
            - NotBlank:     ~
            - Length:
                min:        6
                max:        255
            - Email:        ~
        plainPassword:
            - NotBlank:
                groups:     [Registration]
        enabled:
            - NotNull:      ~
        roles:
            - Count:
                min:        1
                minMessage: 'pim_user.min_role'
        namePrefix:
            - Akeneo\UserManagement\Bundle\Validator\Constraints\ValueShouldNotContainsBlacklistedCharacters: ~
        firstName:
            - NotBlank:     ~
            - Length:
                max:        100
            - Akeneo\UserManagement\Bundle\Validator\Constraints\ValueShouldNotContainsBlacklistedCharacters: ~
        middleName:
            - Akeneo\UserManagement\Bundle\Validator\Constraints\ValueShouldNotContainsBlacklistedCharacters: ~
        lastName:
            - NotBlank:     ~
            - Length:
                max:        100
            - Akeneo\UserManagement\Bundle\Validator\Constraints\ValueShouldNotContainsBlacklistedCharacters: ~
        nameSuffix:
            - Akeneo\UserManagement\Bundle\Validator\Constraints\ValueShouldNotContainsBlacklistedCharacters: ~
        imageFile:
            - Image:        ~
        uiLocale:
            - NotBlank: ~
        catalogLocale:
            - NotBlank: ~
            - Akeneo\Channel\Component\Validator\Constraint\ActivatedLocale: ~
        defaultTree:
            - NotBlank: ~
            - Akeneo\Channel\Component\Validator\Constraint\IsRootCategory: ~
        phone:
            - Regex:
                pattern: '/^\+[0-9]+$/'
                message: "The phone has to respect the international format (eg: +33755667788)."
            - Length:
                max: 20
        timezone:
            - NotBlank: ~
            - Timezone: ~

Akeneo\UserManagement\Component\Model\Role:
    constraints:
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: label
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: role
        - Akeneo\Tool\Component\StorageUtils\Validator\Constraints\Immutable:
            properties:
                - role
    properties:
        role:
            - NotBlank: ~
            - Regex:
                  pattern: '/^(IS_AUTHENTICATED_ANONYMOUSLY|ROLE_[0-9A-Z_-]*)$/'
                  message: pim_user.role.invalid_role_format
        label:
            - NotBlank:     ~
            - Length:
                max:        25

Akeneo\UserManagement\Component\Model\Group:
    constraints:
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: name
    properties:
        name:
            - NotBlank:     ~
            - Length:
                max:        30

Akeneo\UserManagement\Component\Connector\RoleWithPermissions:
    properties:
        role:
            - Valid: ~
        permissions:
            - Akeneo\UserManagement\Bundle\Validator\Constraints\UserRolePrivileges: ~

