ok

Mini Shell

Direktori : /lib/python3.6/site-packages/zope/component/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/zope/component/__pycache__/security.cpython-36.pyc

3

,�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�/usr/lib/python3.6/security.py�__providedBy__"szPermissionProxy.__providedBy__N)r
)�__name__�
__module__�__qualname__�	__slots__r�propertyrrrrrsrcCsx|r|rdg}|tkrt}i}|r<x|D]}|||<q,W|rlx*|D]"}x|jdd�D]}|||<qXWqFWt|�}|S)N�__call__T)�all)�PublicPermissionr	�namesr)Z_context�
permissionZallowed_interfaceZallowed_attributesZrequire�name�i�checkerrrr�_checker&s

rNcCsH|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�|�}y
�|_Wntk
r0t|��}YnX|S)N)r
�AttributeErrorr)�argsr!)r�original_factoryrr�factoryOs
z!protectedFactory.<locals>.factory)rr	r
r')r&r"rr'r)rr&r�protectedFactoryJs
r(cCsJ|tkrt}|s |dk	r6|tk	r6|r,t|�St|�Sn|rBt|�S|SdS)N)rr	rrr)r'rZlocateZtrustedrrr�securityAdapterFactoryYs
r))NNN)�__doc__Zzope.interfacerZ
zope.proxyrrZzope.security.adapterrrrZzope.security.checkerrr	r
Zzope.security.proxyrrrrr#r(r)rrrr�<module>s 


Zerion Mini Shell 1.0