#NEWLINE# def permission_required( f ) : #NEWLINE# #INDENT# def call( request , * args , **kwargs ) : #NEWLINE# #INDENT# for credential in VIEW_PERMISSIONS [ f . func_name ] : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# profile = request . user . get_profile ( ) #NEWLINE# if ( credential not in profile . panel_access ) : #NEWLINE# #INDENT# return warning_response ( request , ugettext_lazy ( ( " Sorry, you don't have access to this panel." + ' Please request access to our team.' ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# return warning_response ( request , ugettext_lazy ( ( " Sorry, you don't have access to this panel." + ' Please request access to our team.' ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# return f ( request ) #NEWLINE# #UNINDENT# call . __doc__ = f . __doc__ #NEWLINE# call . __name__ = f . __name__ #NEWLINE# call . __dict__ . update ( f . __dict__ ) #NEWLINE# return call