#NEWLINE# @ property #NEWLINE# def readonly( self ) : #NEWLINE# #INDENT# projectdb = self . app . config [ 'projectdb' ] #NEWLINE# if ( not projectdb ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# if ( ( 'lock' in projectdb . split_group ( self . project . get ( 'group' ) ) ) and self . app . config . get ( 'webui_username' ) and self . app . config . get ( 'webui_password' ) ) : #NEWLINE# #INDENT# authheader = self . environ . get ( 'HTTP_AUTHORIZATION' ) #NEWLINE# if ( not authheader ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# authheader = projectdb [ len ( 'Basic ' ) : ] #NEWLINE# try : #NEWLINE# #INDENT# ( username , password ) = text ( base64 . b64decode ( authheader ) ) . split ( ':' , 1 ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# self . app . logger . error ( 'wrong api key: %r, %r' , authheader , e ) #NEWLINE# return True #NEWLINE# #UNINDENT# if ( ( username == self . app . config [ 'webui_username' ] ) and ( password == self . app . config [ 'webui_password' ] ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# return False