<s> """<STR_LIT>""" <EOL> from grr . gui import api_call_router <EOL> from grr . gui import api_call_router_without_checks <EOL> from grr . lib import access_control <EOL> from grr . lib import rdfvalue <EOL> from grr . lib . aff4_objects import cronjobs <EOL> from grr . lib . aff4_objects import user_managers <EOL> class ApiCallRouterWithApprovalChecksWithoutRobotAccess ( <EOL> api_call_router . ApiCallRouter ) : <EOL> """<STR_LIT>""" <EOL> full_access_control_manager = None <EOL> def _GetFullAccessControlManager ( self ) : <EOL> cls = ApiCallRouterWithApprovalChecksWithoutRobotAccess <EOL> if cls . full_access_control_manager is None : <EOL> cls . full_access_control_manager = user_managers . FullAccessControlManager ( ) <EOL> return cls . full_access_control_manager <EOL> def CheckClientAccess ( self , client_id , token = None ) : <EOL> self . legacy_manager . CheckClientAccess ( token . RealUID ( ) , client_id ) <EOL> def CheckHuntAccess ( self , hunt_id , token = None ) : <EOL> hunt_urn = rdfvalue . RDFURN ( "<STR_LIT>" ) . Add ( hunt_id ) <EOL> self . legacy_manager . CheckHuntAccess ( token . RealUID ( ) , hunt_urn ) <EOL> def CheckCronJobAccess ( self , cron_job_id , token = None ) : <EOL> cron_job_urn = cronjobs . CRON_JOBS_PATH . Add ( cron_job_id ) <EOL> self . legacy_manager . CheckCronJobAccess ( token . RealUID ( ) , cron_job_urn ) <EOL> def CheckIfCanStartClientFlow ( self , flow_name , token = None ) : <EOL> self . legacy_manager . CheckIfCanStartFlow ( token . RealUID ( ) , flow_name , <EOL> with_client_id = True ) <EOL> def CheckIfCanStartGlobalFlow ( self , flow_name , token = None ) : <EOL> self . legacy_manager . CheckIfCanStartFlow ( token . RealUID ( ) , flow_name , <EOL> with_client_id = False ) <EOL> def __init__ ( self , legacy_manager = None , delegate = None ) : <EOL> super ( ApiCallRouterWithApprovalChecksWithoutRobotAccess , self ) . __init__ ( ) <EOL> if not legacy_manager : <EOL> legacy_manager = self . _GetFullAccessControlManager ( ) <EOL> self . legacy_manager = legacy_manager <EOL> if not delegate : <EOL> delegate = api_call_router_without_checks . ApiCallRouterWithoutChecks ( ) <EOL> self . delegate = delegate <EOL> def GetAff4Object ( self , args , token = None ) : <EOL> self . legacy_manager . CheckDataStoreAccess ( <EOL> token . RealUID ( ) , [ args . aff4_path ] , "<STR_LIT:r>" ) <EOL> return self . delegate . GetAff4Object ( args , token = token ) <EOL> def GetAff4Index ( self , args , token = None ) : <EOL> self . legacy_manager . CheckDataStoreAccess ( <EOL> token . RealUID ( ) , [ args . aff4_path ] , "<STR_LIT:q>" ) <EOL> return self . delegate . GetAff4Index ( args , token = token ) <EOL> def ListArtifacts ( self , args , token = None ) : <EOL> return self . delegate . ListArtifacts ( args , token = token ) <EOL> def UploadArtifact ( self , args , token = None ) : <EOL> return self . delegate . UploadArtifact ( args , token = token ) <EOL> def DeleteArtifacts ( self , args , token = None ) : <EOL> return self . delegate . DeleteArtifacts ( args , token = token ) <EOL> def SearchClients ( self , args , token = None ) : <EOL> return self . delegate . SearchClients ( args , token = token ) <EOL> def GetClient ( self , args , token = None ) : <EOL> return self . delegate . GetClient ( args , token = token ) <EOL> def GetFileDetails ( self , args , token = None ) : <EOL> self . CheckClientAccess ( args . client_id , token = token ) <EOL> return self . delegate . GetFileDetails ( args , token = token ) <EOL> def GetFileList ( self , args , token = None ) : <EOL> self . CheckClientAccess ( args . client_id , token = token ) <EOL> return self . delegate . GetFileList ( args , token = token ) <EOL> def GetFileText ( self , args , token = None ) : <EOL> self . CheckClientAccess ( args . client_id , token = token ) <EOL> return self . delegate . GetFileText ( args , token = token ) <EOL> def GetFileBlob ( self , args , token = None ) : <EOL> self . CheckClientAccess ( args . client_id , token = token ) <EOL> return self . delegate . GetFileBlob ( args , token = token ) <EOL> def GetFileVersionTimes ( self , args , token = None ) : <EOL> self . CheckClientAccess ( args . client_id , token = token ) <EOL> return self . delegate . GetFileVersionTimes ( args , token = token ) <EOL> def GetFileDownloadCommand ( self , args , token = None ) : <EOL> self . CheckClientAccess ( args . client_id , token = token ) <EOL> return self . delegate . GetFileDownloadCommand ( args , token = token ) <EOL> def CreateVfsRefreshOperation ( self , args , token = None ) : <EOL> self . CheckClientAccess ( args . client_id , token = token ) <EOL> return self . delegate . CreateVfsRefreshOperation ( args , token = token ) <EOL> def GetVfsRefreshOperationState ( self , args , token = None ) : <EOL> return self . delegate . GetVfsRefreshOperationState ( args , token = token ) <EOL> def ListClientsLabels ( self , args , token = None ) : <EOL> return self . delegate . ListClientsLabels ( args , token = token ) <EOL> def AddClientsLabels ( self , args , token = None ) : <EOL> return self . delegate . AddClientsLabels ( args , token = token ) <EOL> def RemoveClientsLabels ( self , args , token = None ) : <EOL> return self . delegate . RemoveClientsLabels ( args , token = token ) <EOL> def ListClientFlows ( self , args , token = None ) : <EOL> self . CheckClientAccess ( args . client_id , token = token ) <EOL> return self . delegate . ListClientFlows ( args , token = token ) <EOL> def GetFlow ( self , args , token = None ) : <EOL> self . CheckClientAccess ( args . client_id , token = token ) <EOL> return self . delegate . GetFlow ( args , token = token ) <EOL> def CreateFlow ( self , args , token = None ) : <EOL> self . CheckClientAccess ( args . client_id , token = token ) <EOL> self . CheckIfCanStartClientFlow ( <EOL> args . flow . name or args . flow . runner_args . flow_name , token = token ) <EOL> return self . delegate . CreateFlow ( args , token = token ) <EOL> def CancelFlow ( self , args , token = None ) : <EOL> self . CheckClientAccess ( args . client_id , token = token ) <EOL> return self . delegate . CancelFlow ( args , token = token ) <EOL> def ListFlowResults ( self , args , token = None ) : <EOL> self . CheckClientAccess ( args . client_id , token = token ) <EOL> return self . delegate . ListFlowResults ( args , token = token ) <EOL> def GetFlowResultsExportCommand ( self , args , token = None ) : <EOL> self . CheckClientAccess ( args . client_id , token = token ) <EOL> return self . delegate . GetFlowResultsExportCommand ( args , token = token ) <EOL> def GetFlowFilesArchive ( self , args , token = None ) : <EOL> self . CheckClientAccess ( args . client_id , token = token ) <EOL> return self . delegate . GetFlowFilesArchive ( args , token = token ) <EOL> def ListFlowOutputPlugins ( self , args , token = None ) : <EOL> self . CheckClientAccess ( args . client_id , token = token ) <EOL> return self . delegate . ListFlowOutputPlugins ( args , token = token ) <EOL> def ListFlowOutputPluginLogs ( self , args , token = None ) : <EOL> self . CheckClientAccess ( args . client_id , token = token ) <EOL> return self . delegate . ListFlowOutputPluginLogs ( args , token = token ) <EOL> def ListFlowOutputPluginErrors ( self , args , token = None ) : <EOL> self . CheckClientAccess ( args . client_id , token = token ) <EOL> return self . delegate . ListFlowOutputPluginErrors ( args , token = token ) <EOL> def ListFlowLogs ( self , args , token = None ) : <EOL> self . CheckClientAccess ( args . client_id , token = token ) <EOL> return self . delegate . ListFlowLogs ( args , token = token ) <EOL> def CreateGlobalFlow ( self , args , token = None ) : <EOL> self . CheckIfCanStartGlobalFlow ( <EOL> args . flow . name or args . flow . runner_args . flow_name , token = token ) <EOL> return self . delegate . CreateGlobalFlow ( args , token = token ) <EOL> def ListCronJobs ( self , args , token = None ) : <EOL> return self . delegate . ListCronJobs ( args , token = token ) <EOL> def CreateCronJob ( self , args , token = None ) : <EOL> return self . delegate . CreateCronJob ( args , token = token ) <EOL> def ListHunts ( self , args , token = None ) : <EOL> return self . delegate . ListHunts ( args , token = token ) <EOL> def GetHunt ( self , args , token = None ) : <EOL> return self . delegate . GetHunt ( args , token = token ) <EOL> def ListHuntErrors ( self , args , token = None ) : <EOL> return self . delegate . ListHuntErrors ( args , token = token ) <EOL> def ListHuntLogs ( self , args , token = None ) : <EOL> return self . delegate . ListHuntLogs ( args , token = token ) <EOL> def ListHuntResults ( self , args , token = None ) : <EOL> return self . delegate . ListHuntResults ( args , token = token ) <EOL> def GetHuntResultsExportCommand ( self , args , token = None ) : <EOL> return self . delegate . GetHuntResultsExportCommand ( args , token = token ) <EOL> def ListHuntOutputPlugins ( self , args , token = None ) : <EOL> return self . delegate . ListHuntOutputPlugins ( args , token = token ) <EOL> def ListHuntOutputPluginLogs ( self , args , token = None ) : <EOL> return self . delegate . ListHuntOutputPluginLogs ( args , token = token ) <EOL> def ListHuntOutputPluginErrors ( self , args , token = None ) : <EOL> return self . delegate . ListHuntOutputPluginErrors ( args , token = token ) <EOL> def ListHuntCrashes ( self , args , token = None ) : <EOL> return self . delegate . ListHuntCrashes ( args , token = token ) <EOL> def GetClientCompletionStats ( self , args , token = None ) : <EOL> return self . delegate . GetClientCompletionStats ( args , token = token ) <EOL> def GetHuntStats ( self , args , token = None ) : <EOL> return self . delegate . GetHuntStats ( args , token = token ) <EOL> def GetHuntClients ( self , args , token = None ) : <EOL> return self . delegate . GetHuntClients ( args , token = token ) <EOL> def GetHuntContext ( self , args , token = None ) : <EOL> return self . delegate . GetHuntContext ( args , token = token ) <EOL> def CreateHunt ( self , args , token = None ) : <EOL> return self . delegate . CreateHunt ( args , token = token ) <EOL> def GetHuntFilesArchive ( self , args , token = None ) : <EOL> self . CheckHuntAccess ( rdfvalue . RDFURN ( args . hunt_id ) . Basename ( ) , token = token ) <EOL> return self . delegate . GetHuntFilesArchive ( args , token = token ) <EOL> def GetHuntFile ( self , args , token = None ) : <EOL> self . CheckHuntAccess ( rdfvalue . RDFURN ( args . hunt_id ) . Basename ( ) , token = token ) <EOL> return self . delegate . GetHuntFile ( args , token = token ) <EOL> def ListStatsStoreMetricsMetadata ( self , args , token = None ) : <EOL> return self . delegate . ListStatsStoreMetricsMetadata ( args , token = token ) <EOL> def GetStatsStoreMetric ( self , args , token = None ) : <EOL> return self . delegate . GetStatsStoreMetric ( args , token = token ) <EOL> def CreateUserClientApproval ( self , args , token = None ) : <EOL> return self . delegate . CreateUserClientApproval ( args , token = token ) <EOL> def GetUserClientApproval ( self , args , token = None ) : <EOL> return self . delegate . GetUserClientApproval ( args , token = token ) <EOL> def ListUserClientApprovals ( self , args , token = None ) : <EOL> return self . delegate . ListUserClientApprovals ( args , token = token ) <EOL> def ListUserHuntApprovals ( self , args , token = None ) : <EOL> return self . delegate . ListUserHuntApprovals ( args , token = token ) <EOL> def ListUserCronApprovals ( self , args , token = None ) : <EOL> return self . delegate . ListUserCronApprovals ( args , token = token ) <EOL> def GetUserInfo ( self , args , token = None ) : <EOL> return self . delegate . GetUserInfo ( args , token = token ) <EOL> def GetPendingUserNotificationsCount ( self , args , token = None ) : <EOL> return self . delegate . GetPendingUserNotificationsCount ( <EOL> args , token = token ) <EOL> def GetPendingUserNotifications ( self , args , token = None ) : <EOL> return self . delegate . GetPendingUserNotifications ( <EOL> args , token = token ) <EOL> def DeletePendingUserNotification ( self , args , token = None ) : <EOL> return self . delegate . DeletePendingUserNotification ( <EOL> args , token = token ) <EOL> def GetAndResetUserNotifications ( self , args , token = None ) : <EOL> return self . delegate . GetAndResetUserNotifications ( args , token = token ) <EOL> def GetUserSettings ( self , args , token = None ) : <EOL> return self . delegate . GetUserSettings ( args , token = token ) <EOL> def UpdateUserSettings ( self , args , token = None ) : <EOL> return self . delegate . UpdateUserSettings ( args , token = token ) <EOL> def GetConfig ( self , args , token = None ) : <EOL> return self . delegate . GetConfig ( args , token = token ) <EOL> def GetConfigOption ( self , args , token = None ) : <EOL> return self . delegate . GetConfigOption ( args , token = token ) <EOL> def ListKbFields ( self , args , token = None ) : <EOL> return self . delegate . ListKbFields ( args , token = token ) <EOL> def ListFlowDescriptors ( self , args , token = None ) : <EOL> return self . delegate . ListFlowDescriptors ( args , token = token ) <EOL> def ListAff4AttributeDescriptors ( self , args , token = None ) : <EOL> return self . delegate . ListAff4AttributeDescriptors ( args , token = token ) <EOL> def GetRDFValueDescriptor ( self , args , token = None ) : <EOL> return self . delegate . GetRDFValueDescriptor ( args , token = token ) <EOL> def ListRDFValuesDescriptors ( self , args , token = None ) : <EOL> return self . delegate . ListRDFValuesDescriptors ( args , token = token ) <EOL> def ListOutputPluginDescriptors ( self , args , token = None ) : <EOL> return self . delegate . ListOutputPluginDescriptors ( args , token = token ) <EOL> def ListKnownEncodings ( self , args , token = None ) : <EOL> return self . delegate . ListKnownEncodings ( args , token = token ) <EOL> def GetDocs ( self , args , token = None ) : <EOL> return self . delegate . GetDocs ( args , token = token ) <EOL> def StartGetFileOperation ( self , args , token = None ) : <EOL> raise access_control . UnauthorizedAccess ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> def GetFlowStatus ( self , args , token = None ) : <EOL> raise access_control . UnauthorizedAccess ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> class ApiCallRouterWithApprovalChecksWithRobotAccess ( <EOL> ApiCallRouterWithApprovalChecksWithoutRobotAccess ) : <EOL> def StartGetFileOperation ( self , args , token = None ) : <EOL> return self . delegate . StartGetFileOperation ( args , token = token ) <EOL> def GetFlowStatus ( self , args , token = None ) : <EOL> return self . delegate . GetFlowStatus ( args , token = token ) </s>
