#NEWLINE# def CheckAccess( self , token ) : #NEWLINE# #INDENT# super ( ClientApproval , self ) . CheckAccess ( token ) #NEWLINE# if ( not client_approval_auth . CLIENT_APPROVAL_AUTH_MGR . IsActive ( ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# now = rdfvalue . RDFDatetime ( ) . Now ( ) #NEWLINE# approvers = self . GetApprovers ( now ) #NEWLINE# ( requester , client_urn ) = self . InferUserAndSubjectFromUrn ( ) #NEWLINE# try : #NEWLINE# #INDENT# client_object = aff4 . FACTORY . Open ( client_urn , mode = 'r' , aff4_type = 'VFSGRRClient' , token = token . SetUID ( ) ) #NEWLINE# #UNINDENT# except aff4 . InstantiationError : #NEWLINE# #INDENT# raise ErrorClientDoesNotExist ( ( "Can't check label approvals on client %s that doesn't exist" % client_urn ) ) #NEWLINE# #UNINDENT# client_labels = client_object . Get ( client_object . Schema . LABELS , [ ] ) #NEWLINE# for label in client_labels : #NEWLINE# #INDENT# client_approval_auth . CLIENT_APPROVAL_AUTH_MGR . CheckApproversForLabel ( token , client_urn , requester , approvers , label . name ) #NEWLINE# #UNINDENT# return True