#NEWLINE# def post_process_results( self , results ) : #NEWLINE# #INDENT# to_cache = super ( RestrictedSearchQuerySet , self ) . post_process_results ( results ) #NEWLINE# view_perm = get_view_permission ( ) #NEWLINE# view_perm_name = '{0}.{1}' . format ( view_perm . content_type . app_label , view_perm . codename ) #NEWLINE# if self . user . has_perm ( view_perm_name ) : #NEWLINE# #INDENT# return to_cache #NEWLINE# #UNINDENT# check_ids = [ ] #NEWLINE# for result in to_cache : #NEWLINE# #INDENT# if ( result . restriction_id and result . restriction_content_type_id ) : #NEWLINE# #INDENT# check_ids . append ( ( result . restriction_content_type_id , result . restriction_id ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( self . user and check_ids ) : #NEWLINE# #INDENT# result_ids = set ( filter_object_id_list ( check_ids , self . user . id , get_view_permission ( ) . id ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result_ids = set ( ) #NEWLINE# #UNINDENT# def check_id( result ) : #NEWLINE# #INDENT# in_ids = ( ( result . restriction_content_type_id , result . restriction_id ) in result_ids ) #NEWLINE# return ( in_ids or ( result . restriction_id is None ) ) #NEWLINE# #UNINDENT# return [ result for result in to_cache if check_id ( result ) ]