HEX
Server: Apache
System: Linux srv1.prosuiteplus.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: prosuiteplus (1001)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/zope/component/__pycache__/security.cpython-38.pyc
U

,�W)�@s�dZddlmZddlmZddlmZddlmZddlmZddlm	Z	ddl
mZdd	l
mZdd
l
m
Z
ddlmZdZGd
d�de�Zdd�Zddd�Zdd�Zdd�ZdS)z5zope.security support for the configuration handlers
�)�
providedBy)�	ProxyBase)�getProxiedObject)�LocatingTrustedAdapterFactory)�LocatingUntrustedAdapterFactory)�TrustedAdapterFactory)�Checker)�
CheckerPublic)�InterfaceChecker)�Proxyzzope.Publicc@s eZdZdZdd�Zee�ZdS)�PermissionProxy)�__Security_checker__cCstt|��S�N)rr)�self�r�9/usr/lib/python3/dist-packages/zope/component/security.py�__providedBy__"szPermissionProxy.__providedBy__N)�__name__�
__module__�__qualname__�	__slots__r�propertyrrrrrsrcCsh|s|sdg}|tkrt}i}|r4|D]}|||<q&|r\|D]}|jdd�D]}|||<qLq<t|�}|S)N�__call__T)�all)�PublicPermissionr	�namesr)Z_context�
permissionZallowed_interfaceZallowed_attributesZrequire�name�i�checkerrrr�_checker&s
r NcCsH|dkr6|dks|dkr td��|tkr,t}t||�}t|�}||_|S)z�Try 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.
    Nz<Required arguments: checker or both provides and permissions)�
ValueErrorrr	r
rr
)�obr�providesrrrr�proxify9s
r$cs.|tkrt}t||����fdd�}�|_|S)Ncs6�|�}z
�|_Wntk
r0t|��}YnX|Sr)r
�AttributeErrorr)�argsr"�r�original_factoryrr�factoryOs
z!protectedFactory.<locals>.factory)rr	r
r))r(r#rr)rr'r�protectedFactoryJs
r*cCsJ|tkrt}|s |dk	r6|tk	r6|r,t|�St|�Sn|rBt|�S|SdSr)rr	rrr)r)rZlocateZtrustedrrr�securityAdapterFactoryYs
r+)NNN)�__doc__Zzope.interfacerZ
zope.proxyrrZzope.security.adapterrrrZzope.security.checkerrr	r
Zzope.security.proxyrrrr r$r*r+rrrr�<module>s