
    YR
h	                         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mZ dd
lmZ  eedd          Ze                    d          s ee          neZd Zd Zd Zd ZdS )    wraps)settings)PermissionDenied)HttpResponseForbidden)get_object_or_404)reverse_lazy)gettext   )MapTeam)simple_json_response	LOGIN_URLlogin/c                 <     t                      fd            }|S )Nc                     t          t          dd          s.| j        j        s"t	          t          t                              S  | g|R i |S )NUMAP_ALLOW_ANONYMOUSFlogin_required)getattrr   useris_authenticatedr   strr   )requestargskwargs	view_funcs      8/var/www/html/01_SiteInternet/03_Maps/umap/decorators.pywrapperz8login_required_if_not_anonymous_allowed.<locals>.wrapper   sb     "8%@@	GL1	G (s9~~FFFFy242226222    r   r   r    s   ` r   'login_required_if_not_anonymous_allowedr#      s6    
93 3 3 3 3 Nr!   c                 <     t                      fd            }|S )z5
    Used for URLs dealing with editing the map.
    c                 4   t          t          |d                   }||d<   |j        |j        k    r[|                    |           }|sC|j        r.| j        j        s"t          t          t                              S t                      S  | g|R i |S )Nmap_idpkmap_inst)r   r   )r   r   edit_statusCOLLABORATORScan_editownerr   r   r   r   r   r   )r   r   r   r)   r,   r   s        r   r    zcan_edit_map.<locals>.wrapper#   s    $SVH-=>>>%z8#999(((99H /> O',*G O/s9~~NNNN,...y242226222r!   r   r"   s   ` r   can_edit_mapr.      s8    
 9	3 	3 	3 	3 	3 Nr!   c                 <     t                      fd            }|S )z5
    Used for URLs dealing with viewing the map.
    c                     t          t          |d                   }||d<   |                    |           st          t	          d                     | g|R i |S )Nr&   r'   r)   z"This map is not publicly available)r   r   can_viewr   _)r   r   r   r)   r   s       r   r    zcan_view_map.<locals>.wrapper7   sr    $SVH-=>>>%z  )) 	L"1%I#J#JKKKy242226222r!   r   r"   s   ` r   can_view_mapr3   2   s8    
 93 3 3 3 3 Nr!   c                 <     t                      fd            }|S )Nc                     t          t          |d                   }| j        j        r || j        j                                        vrt                      S  | g|R i |S )Nr(   r'   )r   r   r   r   teamsallr   )r   r   r   teamr   s       r   r    z"team_members_only.<locals>.wrapperC   sm     &,777|, 	+GL<N<R<R<T<T0T0T(***y242226222r!   r   r"   s   ` r   team_members_onlyr9   B   s6    
93 3 3 3 3 Nr!   N)	functoolsr   django.confr   django.core.exceptionsr   django.httpr   django.shortcutsr   django.urlsr	   django.utils.translationr
   r2   modelsr   r   viewsr   r   r   
startswithr#   r.   r3   r9    r!   r   <module>rE      s-                     3 3 3 3 3 3 - - - - - - . . . . . . $ $ $ $ $ $ 1 1 1 1 1 1         ' ' ' ' ' 'GHk733	+4+?+?+D+DSLL###)	
 
 
  (       r!   