o
    {,hw                     @   s(   G d d dZ G dd dZdd ZdS )c                   @   4   e Zd Zdd Zdd Zdd Zdd Zd	d
 ZdS )PermLookupDictc                 C   s   ||| _ | _d S N)user	app_label)selfr   r    r   \/var/www/html/rh/venv/lib/python3.10/site-packages/django/contrib/auth/context_processors.py__init__   s   zPermLookupDict.__init__c                 C   s   t | j S r   )strr   get_all_permissionsr   r   r   r   __repr__	      zPermLookupDict.__repr__c                 C   s   | j d| j|f S )Nz%s.%s)r   has_permr   )r   	perm_namer   r   r   __getitem__      zPermLookupDict.__getitem__c                 C      t d)NzPermLookupDict is not iterable.	TypeErrorr   r   r   r   __iter__   s   zPermLookupDict.__iter__c                 C   s   | j | jS r   )r   has_module_permsr   r   r   r   r   __bool__   r   zPermLookupDict.__bool__N)__name__
__module____qualname__r	   r   r   r   r   r   r   r   r   r      s    r   c                   @   r   )PermWrapperc                 C   s
   || _ d S r   )r   )r   r   r   r   r   r	      s   
zPermWrapper.__init__c                 C   s   | j j d| jdS )N())	__class__r   r   r   r   r   r   r      r   zPermWrapper.__repr__c                 C   s   t | j|S r   )r   r   )r   r   r   r   r   r      s   zPermWrapper.__getitem__c                 C   r   )NzPermWrapper is not iterable.r   r   r   r   r   r   "   s   zPermWrapper.__iter__c                 C   s0   d|vr
t | | S |dd\}}| | | S )zE
        Lookup by "someapp" or "someapp.someperm" in perms.
        .   )boolsplit)r   r   r   r   r   r   __contains__&   s   zPermWrapper.__contains__N)r   r   r   r	   r   r   r   r$   r   r   r   r   r      s    r   c                 C   s2   t | dr	| j}n	ddlm} | }|t|dS )z
    Return context variables required by apps that use Django's authentication
    system.

    If there is no 'user' attribute in the request, use AnonymousUser (from
    django.contrib.auth).
    r       )AnonymousUser)r   perms)hasattrr   django.contrib.auth.modelsr&   r   )requestr   r&   r   r   r   auth1   s   
r+   N)r   r   r+   r   r   r   r   <module>   s   