
    Og)                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ dd	l
mZ dd
l
mZ ddlmZ dZ G d de      Zd ZddZd Zd Zy)z5zope.security support for the configuration handlers
    )
providedBy)	ProxyBase)getProxiedObject)LocatingTrustedAdapterFactory)LocatingUntrustedAdapterFactory)TrustedAdapterFactory)Checker)CheckerPublic)InterfaceChecker)Proxyzzope.Publicc                   &    e Zd ZdZd Z ee      Zy)PermissionProxy)__Security_checker__c                 *    t        t        |             S N)r   r   )selfs    R/var/www/djangounited/venv/lib/python3.12/site-packages/zope/component/security.py__providedBy__zPermissionProxy.__providedBy__"   s    *4011    N)__name__
__module____qualname__	__slots__r   property r   r   r   r      s    *I2n-Nr   r   c                     |s|sdg}|t         k(  rt        }i }|r|D ]  }|||<   	 |r#|D ]  }|j                  d      D ]  }|||<   	   t        |      }|S )N__call__T)all)PublicPermissionr
   namesr	   )_context
permissionallowed_interfaceallowed_attributesrequirenameicheckers           r   _checkerr)   &   s    ):(\%%"
G& 	'D&GDM	'" 	+AD) + *+	+ gGNr   Nc                     |*||t        d      |t        k(  rt        }t        ||      }t	        |       } || _        | S )zTry to get the object proxied with the `checker`, but not too soon

    We really don't want to proxy the object unless we need to.
    z<Required arguments: checker or both provides and permissions)
ValueErrorr   r
   r   r   r   )obr(   providesr"   s       r   proxifyr.   9   sZ     z1 K L L))&J"8Z8		B%BIr   c                 Z     |t         k(  rt        }t        ||       fd} |_        |S )Nc                  Z     |  }	 |_         |S # t        $ r t        |      }Y |S w xY wr   )r   AttributeErrorr   )argsr,   r(   original_factorys     r   factoryz!protectedFactory.<locals>.factoryO   sC    t$	$&-B# 	  	$r7#B		$s    **)r   r
   r   r4   )r3   r-   r"   r4   r(   s   `   @r   protectedFactoryr5   J   s0    %%"
x4G 'GONr   c                     |t         k(  rt        }|s
| |t        ur|rt        |       S t        |       S |rt	        |       S | S r   )r   r
   r   r   r   )r4   r"   locatetrusteds       r   securityAdapterFactoryr9   Y   sK    %%"
*(Z}-L09927;;	$W--r   )NNN)__doc__zope.interfacer   
zope.proxyr   r   zope.security.adapterr   r   r   zope.security.checkerr	   r
   r   zope.security.proxyr   r   r   r)   r.   r5   r9   r   r   r   <module>r@      sP    %   ' ? A 7 ) / 2 % ! .i .&"r   