https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/django/contrib/auth/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/django/contrib/auth/__pycache__/mixins.cpython-310.pyc
o

�a��@s�ddlmZddlmZddlmZddlmZddlm	Z	m
Z
ddlmZGdd�d�Z
Gd	d
�d
e
�ZGdd�de
�ZGd
d�de
�ZdS)�)�urlparse)�settings)�REDIRECT_FIELD_NAME)�redirect_to_login)�ImproperlyConfigured�PermissionDenied)�resolve_urlc@s@eZdZdZdZdZdZeZdd�Z	dd�Z
d	d
�Zdd�ZdS)
�AccessMixinz^
    Abstract CBV mixin that gives access mixins the same customizable
    functionality.
    N�FcCs*|jptj}|std�|jj���t|�S)zK
        Override this method to override the login_url attribute.
        zr{0} is missing the login_url attribute. Define {0}.login_url, settings.LOGIN_URL, or override {0}.get_login_url().)�	login_urlr�	LOGIN_URLr�format�	__class__�__name__�str)�selfr�r�</usr/lib/python3/dist-packages/django/contrib/auth/mixins.py�
get_login_urls
�zAccessMixin.get_login_urlcC�|jS)z[
        Override this method to override the permission_denied_message attribute.
        )�permission_denied_message�rrrr�get_permission_denied_message �z)AccessMixin.get_permission_denied_messagecCr)zU
        Override this method to override the redirect_field_name attribute.
        )�redirect_field_namerrrr�get_redirect_field_name&rz#AccessMixin.get_redirect_field_namecCs�|js|jjjrt|����|j��}t|���}t	|�dd�\}}t	|�dd�\}}|r3||kr>|r9||kr>|j�
�}t|||���S)N�)
�raise_exception�request�user�is_authenticatedrr�build_absolute_urirrr�
get_full_pathrr)r�path�resolved_login_url�login_scheme�login_netloc�current_scheme�current_netlocrrr�handle_no_permission,s$
��
�z AccessMixin.handle_no_permission)
r�
__module__�__qualname__�__doc__rrrrrrrrr)rrrrr	
sr	cs eZdZdZ�fdd�Z�ZS)�LoginRequiredMixinz.Verify that the current user is authenticated.cs*|jjs|��St�j|g|�Ri|��S�N)rr r)�super�dispatch�rr�args�kwargs�rrrr0D�zLoginRequiredMixin.dispatch)rr*r+r,r0�
__classcell__rrr4rr-Bsr-cs4eZdZdZdZdd�Zdd�Z�fdd�Z�ZS)	�PermissionRequiredMixinz;Verify that the current user has all specified permissions.NcCs>|jdurtd�|jj���t|jt�r|jf}|S|j}|S)zv
        Override this method to override the permission_required attribute.
        Must return an iterable.
        Nz|{0} is missing the permission_required attribute. Define {0}.permission_required, or override {0}.get_permission_required().)�permission_requiredrr
rr�
isinstancer�r�permsrrr�get_permission_requiredNs

��z/PermissionRequiredMixin.get_permission_requiredcCs|��}|jj�|�S)zT
        Override this method to customize the way permissions are checked.
        )r<rr�	has_permsr:rrr�has_permission^sz&PermissionRequiredMixin.has_permissioncs*|��s|��St�j|g|�Ri|��Sr.)r>r)r/r0r1r4rrr0er5z PermissionRequiredMixin.dispatch)	rr*r+r,r8r<r>r0r6rrr4rr7Jsr7cs0eZdZdZdd�Zdd�Z�fdd�Z�ZS)�UserPassesTestMixinz]
    Deny a request with a permission error if the test_func() method returns
    False.
    cCstd�|jj���)Nz;{} is missing the implementation of the test_func() method.)�NotImplementedErrorr
rrrrrr�	test_funcqs�zUserPassesTestMixin.test_funccCr)zK
        Override this method to use a different test_func method.
        )rArrrr�
get_test_funcvrz!UserPassesTestMixin.get_test_funccs0|���}|s|��St�j|g|�Ri|��Sr.)rBr)r/r0)rrr2r3�user_test_resultr4rrr0|s
zUserPassesTestMixin.dispatch)rr*r+r,rArBr0r6rrr4rr?ks
r?N)�urllib.parser�django.confr�django.contrib.authr�django.contrib.auth.viewsr�django.core.exceptionsrr�django.shortcutsrr	r-r7r?rrrr�<module>s8!

https://t.me/RX1948 - 2025