#NEWLINE# def check_view_permissions( self ) : #NEWLINE# #INDENT# '\n        Returns True if the user has required permissions.\n        ' #NEWLINE# if ( self . action == 'retrieve' ) : #NEWLINE# #INDENT# result = self . get_access_permissions ( ) . can_retrieve ( self . request . user ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . action in ( 'metadata' , 'list' ) ) : #NEWLINE# #INDENT# result = self . request . user . has_perm ( 'core.can_see_projector' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . action in ( 'activate_elements' , 'prune_elements' , 'update_elements' , 'deactivate_elements' , 'clear_elements' , 'control_view' ) ) : #NEWLINE# #INDENT# result = ( self . request . user . has_perm ( 'core.can_see_projector' ) and self . request . user . has_perm ( 'core.can_manage_projector' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = False #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return result