OwlCyberSecurity - MANAGER
Edit File: peruserdata.pyc
� �t�ac @ s[ d d l m Z d d l m Z m Z m Z m Z m Z d g Z d e f d � � YZ d S( i����( t CalendarFilter( t Componentt Propertyt PERUSER_COMPONENTt PERUSER_UIDt PERINSTANCE_COMPONENTt PerUserDataFilterc B s� e Z d Z d Z d Z e j g Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z RS( s Filter per-user data t TRANSPt VALARMc C s | | _ d S( sz @param uid: unique identifier of the user for whom the data is being filtered @type uid: C{str} N( t uid( t selfR ( ( s8 /opt/cpanel-ccs/twistedcaldav/datafilters/peruserdata.pyt __init__I s c C s� | j | � } d } x� t | j � � D]q } | j � t k r( | j t � | j k rh | j | � q� | d k r� | } | j | � q� t d � � q( q( W| r� | j | | � n | j | � | S( sH Filter the supplied iCalendar object using the request information. Assume that the object is a CalDAV calendar resource. @param ical: iCalendar object - this will be modified and returned @type ical: L{Component} or C{str} @return: L{Component} for the filtered calendar data sD Can't have two X-CALENDARSERVER-PERUSER components for the same userN( t validCalendart Nonet tuplet subcomponentst nameR t propertyValueR R t removeComponentt AssertionErrort _filterBackt _defaultFilter( R t icalt peruser_componentt component( ( s8 /opt/cpanel-ccs/twistedcaldav/datafilters/peruserdata.pyt filterR s c C s� i } xR | j � D]D } | j � t k rG t d | j � f � � n | | | j � <q Wt | j � � } t | j � � } | j | � } | j | � } | j | � } | j � d k rxb | D]N } | j | � } | d k r� q� n | | } | j | | � | j | � q� Wn | r#n x7 | D]/ } | j | � } | | } | j | | � q*W| r�| j d � } | r�x0 | D]% } | j | � } | j | | � qWq�n d S( s� Merge the per-user data back into the main calendar data. @param ical: main calendar data to merge into @type ical: L{Component} @param peruser: the per-user data to merge in @type peruser: L{Component} s@ Wrong sub-component '%s' in a X-CALENDARSERVER-PERUSER componentN( R R R R t getRecurrenceIDUTCt sett getComponentInstancest keyst intersectiont differencet masterComponentR t deriveInstancet _filterBackComponentt addComponentt overriddenComponentt get( R R t perusert peruser_recurrence_mapt subcomponentt ical_recurrence_sett peruser_recurrence_sett union_sett ical_only_sett peruser_only_sett ridt ical_componentR t peruser_master( ( s8 /opt/cpanel-ccs/twistedcaldav/datafilters/peruserdata.pyR v s<