security:
    encoders:
        App\Entity\User:
            algorithm: bcrypt
 
    providers:
        api_user_provider:
            entity:
                class: App\Entity\User
                property: username
 
    firewalls:
        login:
            pattern:  ^/api/login
            stateless: true
            anonymous: true
            form_login:
                check_path:               /api/login_check
                success_handler:          lexik_jwt_authentication.handler.authentication_success
                failure_handler:          lexik_jwt_authentication.handler.authentication_failure
                require_previous_session: false
 
        api:
            pattern:   ^/
            anonymous: true
            provider: api_user_provider
            guard:
                authenticators:
                    - lexik_jwt_authentication.jwt_token_authenticator

    role_hierarchy:
        ROLE_STUDENT_EMBASSADOR: [ROLE_STUDENT]
        ROLE_FACILITATOR: [ROLE_STUDENT_EMBASSADOR]
        ROLE_EMBASSADOR: [ROLE_FACILITATOR]
        ROLE_PROJECT_QUALIFIER: [ROLE_EMBASSADOR]
        ROLE_LANGUAGE_ADMIN: [ROLE_PROJECT_QUALIFIER]
        ROLE_ADMIN:          [ROLE_LANGUAGE_ADMIN]
 
    access_control:
        - { path: ^/api/login_check,                roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/api/active_user,                roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/api/login,                      roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/api/register,                   roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/group,                          roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/group/show,                     roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/group/show,                     roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/introduction/show/group,        roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/introduction/show,              roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/student/new,                    roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/user/otp/resetpassword,         roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/user/otp/new,                   roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/user/otp/match,                 roles: IS_AUTHENTICATED_ANONYMOUSLY }

        - { path: ^/admin,                          roles: ROLE_LANGUAGE_ADMIN }

        - { path: ^/ambassador/country,             roles: ROLE_EMBASSADOR }
        - { path: ^/ambassador/$,                   roles: ROLE_LANGUAGE_ADMIN }
        - { path: ^/ambassador/pagination,          roles: ROLE_EMBASSADOR }
        - { path: ^/ambassador/contract,            roles: ROLE_LANGUAGE_ADMIN }
        - { path: ^/ambassador/lastgraduated,       roles: ROLE_LANGUAGE_ADMIN }
        - { path: ^/ambassador/new,                 roles: ROLE_LANGUAGE_ADMIN }
        - { path: ^/ambassador/edit,                roles: ROLE_LANGUAGE_ADMIN }
        - { path: ^/ambassador/delete,              roles: ROLE_LANGUAGE_ADMIN }
        - { path: ^/ambassador/show,                roles: ROLE_STUDENT_EMBASSADOR }
        - { path: ^/ambassador/editpassword,        roles: ROLE_LANGUAGE_ADMIN }
        - { path: ^/ambassador/spreadsheet/list,    roles: ROLE_LANGUAGE_ADMIN }

        - { path: ^/answer,                         roles: ROLE_STUDENT }

        - { path: ^/user/$,                         roles: ROLE_LANGUAGE_ADMIN }
        - { path: ^/user/new,                       roles: ROLE_STUDENT }
        - { path: ^/user/reset_password,            roles: ROLE_STUDENT }
        - { path: ^/user/delete,                    roles: ROLE_FACILITATOR }
        - { path: ^/user/search,                    roles: ROLE_LANGUAGE_ADMIN }
        

        - { path: ^/course/new,                     roles: ROLE_LANGUAGE_ADMIN }
        - { path: ^/course/clone,                   roles: ROLE_LANGUAGE_ADMIN }
        - { path: ^/course/edit,                    roles: ROLE_LANGUAGE_ADMIN }
        - { path: ^/course/delete,                  roles: ROLE_LANGUAGE_ADMIN }

        - { path: ^/certificate,                    roles: ROLE_STUDENT_EMBASSADOR }

        - { path: ^/code,                           roles: ROLE_EMBASSADOR }

        - { path: ^/contract,                       roles: ROLE_EMBASSADOR }

        - { path: ^/grant,                          roles: ROLE_EMBASSADOR }

        - { path: ^/grantmember,                    roles: ROLE_EMBASSADOR }

        - { path: ^/grantrequirement,               roles: ROLE_EMBASSADOR }

        - { path: ^/payment,                        roles: ROLE_LANGUAGE_ADMIN }

        - { path: ^/file,                           roles: ROLE_STUDENT }

        - { path: ^/principle,                      roles: ROLE_STUDENT }

        - { path: ^/programmbs,                     roles: ROLE_STUDENT }

        - { path: ^/programsa,                      roles: ROLE_STUDENT }

        - { path: ^/progress,                       roles: ROLE_STUDENT }

        - { path: ^/report,                         roles: ROLE_STUDENT_EMBASSADOR }

        - { path: ^/api/ota,                        roles: ROLE_LANGUAGE_ADMIN }

        - { path: ^/group/delete,                   roles: ROLE_FACILITATOR }

        - { path: ^/resource/delete,                roles: ROLE_LANGUAGE_ADMIN }

        - { path: ^/resourcecategory/delete,        roles: ROLE_LANGUAGE_ADMIN }

        - { path: ^/stop/reset,                     roles: ROLE_LANGUAGE_ADMIN }

        - { path: ^/tracking,                       roles: ROLE_LANGUAGE_ADMIN }

        - { path: ^/student/delete,                 roles: ROLE_FACILITATOR }

        - { path: ^/wellness/delete,                roles: ROLE_LANGUAGE_ADMIN }

        - { path: ^/transfer,                       roles: ROLE_EMBASSADOR }

        - { path: ^/translation/delete,             roles: ROLE_LANGUAGE_ADMIN }
        - { path: ^/translation/new,                roles: ROLE_LANGUAGE_ADMIN }
        - { path: ^/translation/edit,               roles: ROLE_LANGUAGE_ADMIN }

        - { path: ^/tutorial/delete,                roles: ROLE_LANGUAGE_ADMIN }
        - { path: ^/tutorial/new,                   roles: ROLE_LANGUAGE_ADMIN }
        - { path: ^/tutorial/edit,                  roles: ROLE_LANGUAGE_ADMIN }

        - { path: ^/unit/delete,                    roles: ROLE_LANGUAGE_ADMIN }
        - { path: ^/unit/new,                       roles: ROLE_LANGUAGE_ADMIN }
        - { path: ^/unit/edit,                      roles: ROLE_LANGUAGE_ADMIN }

       
