mò /á¸Ec@sddd!ZdklZdklZdklZdklZdkl Z dk l Z d k l Z d klZlZd kZhd d <dd<dd<dd<ddtexec( tbindtextttexttassigned_namesRR%tjointcodetexttcompileR(R R(R*R,R)R((Rt_generateCodeBlock_s cCs”g}g}|i}xY|iD]N\}}|i|ƒo2||}|i |ƒ|i d||fƒqqWdt |dƒ}|i ||ƒS(Ns"%s":%s,s{%s}R(texprtextR*R RR RRRRRR%R+R)R.(R RRRR)R R/R*((Rt_createCodeBlockForMappingjs    c CsÉg} g}|i}xŽ|D]†} d}xk|iD]`\}}|i |ƒoD||}|| jo)|i d|ƒ| i |ƒd}Pq’q2q2W|oPqqWdt|dƒ}|i|| ƒS(Nis%s,is(%s)R(R*R/R RR targNamestargNametpassedLastBoundArgRRRRRR%R+R)R.( R R1RRR3RR)R R/R2R*((Rt_createCodeBlockForTuplezs&       (Rsself._getContext()(Rsself._getContainer()(Rsself(Rs(self._getNamespace(caller_namespace, kw)(Rsself._getTraverseSubpath()(t__name__t __module__RtreR-tmatchR Rt*__allow_access_to_unprotected_subobjects__RRRRR!R#R&R.R0R4(((RR "s      (s UnauthorizedtUnauthorizedBindingcBsOtZdZd„ZdZeZd„Zed„Z d„Z e Z Z Z RS(s¥Explanation: as of Zope 2.6.3 a security hole was closed - no security check was happening when 'context' and 'container' were bound to a script. Adding the check broke lots of sites where existing scripts had the container binding but the users of the scripts didn't have access to the container (e.g. workflow scripts). This meant getting unauthorized even if the container binding wasn't used in the script. Now, instead of raising unauthorized at binding time, we bind to an UnauthorizedBinding that will allow the script to run if it doesn't actually use the binding, but will raise a meaningful unauthorized error if the binding is accessed. This makes the backward compatibility problem less painful because only those actually using the container binding (for ex. workflow scripts) need to take explicit action to fix existing sites.cCs||_||_dS(N(RR t_nametwrappedt_wrapped(R RR<((RR¨s icCs d|iS(Ns(R R;(R ((Rt__repr__¯scCs1|idƒo|iƒnt|i||ƒS(Nt__(Rt startswithR t_UnauthorizedBinding__you_losetguarded_getattrR=R(R RR((Rt __getattr__²scCs!|id}td|ƒ‚dS(NR;s$Not authorized to access binding: %s(R t__dict__Rt Unauthorized(R R((Rt __you_lose»s (R5R6t__doc__RR9t_what_not_even_god_should_dot __roles__R>tNoneRCRAt__str__t__call__t index_html(((RR:—s    tBindingscBsàtZeƒZdZeiddƒd„Zeiddƒd„Zd„Z hd„Z eie dƒd „Z d „Z d „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„ZeZd„ZRS(NsChange bindingstZBindings_editcCs'|i|ƒ}|iƒ|iƒdS(N(R t_setupBindingsRtnamest_prepareBindCodet_editedBindings(R RRQ((RROÈs tZBindings_setClientcCst|ƒ|_dS(s¤Name the binding to be used as the "client". This is used by classes such as DTMLFile that want to choose an object on which to operate by default.N(tstrt clientnameR t_Bindings_client(R RV((RRTÎscCsdS(N((R ((RRSÕscCst|ƒ|_}|S(N(R RQR t _bind_names(R RQ((RRPÙstgetBindingAssignmentscCs%t|dƒp|iƒn|iS(NRX(thasattrR RPRX(R ((RRYÞscCsy|d}|iƒ}|idƒ p|ot|i|dƒodSn|}g|(|i ƒ|i d|ƒdS(NtTraversalRequestNameStackRiÿÿÿÿR ( trequesttpathR RYRQRRZtaq_basetsubpathtreversetset(R tself2R\R_RQR]((Rt__before_publishing_traverse__ãs  / cCs |iƒS(N(RQR0(R RQ((Rt_createBindCodeîscCsT|iƒ}|iƒo|i|ƒ\}}n d\}}||_||_ |S(Ni(Ni( R RYRQRRdtbindcodet bindcountRJt _v_bindcodet _v_bindcount(R RfReRQ((RRRñs     cCs:t|dtƒ}|tjo|iƒ|i}n|S(NRh(tgetattrR RRfRRRh(R Rf((Rt _getBindCounts    cCs¦xŸ|i}t|ddƒp~t|ddƒ}t|ddƒ}t|ddƒ}ytƒi||d|ƒWn t j ot d|ƒSnX|SqqWdS(Nit_is_wrapperisht aq_parenttaq_innerRR( R RlRiRJtparenttinnerRtgetSecurityManagertvalidateRER:(R RRnRo((Rt _getContexts cCs©x¢|ii}t|ddƒp~t|ddƒ}t|ddƒ}t|ddƒ}ytƒi ||d|ƒWn t j ot d|ƒSnX|SqqWdS(NiRkRlRmRR( R RmRlRiRJRnRoRRpRqRER:(R RRnRo((Rt _getContainers cCs2t|dƒo|iiidgƒSngSdS(NtREQUESTR (RZR RttotherR(R ((Rt_getTraverseSubpath"scCs]|djo1|iƒ}|idƒ}|i|dƒ}n|djo|i ƒSn|S(NR( tcaller_namespaceRJR RYRQR!RtkwRt_Bindings_ns_class(R RwRxRRQ((Rt _getNamespace)s   cOs|i||dƒS(sCalls the script.N(R t _bindAndExectargsRxRJ(R R|Rx((RRL7scCsh}|iƒidƒoP|i}xD|i|i D].}y||||