#NEWLINE# def CheckFlowCanBeStartedOnClient( flow_name ) : #NEWLINE# #INDENT# "Checks if flow can be started on a particular client.\n\n  Two kinds of flows can be started on clients by unprivileged users:\n  1) ACL_ENFORCED=False flows, because they're expected to do their own ACL\n     checking and are often used by AdminUI to execute code with elevated\n     privileges.\n  2) Flows with a category. Having a category means that the flow will be\n     accessible from the UI.\n\n  Args:\n    flow_name: Name of the flow to check access for.\n  Returns:\n    True if flow is externally accessible.\n  Raises:\n    access_control.UnauthorizedAccess: if flow is not externally accessible.\n  " #NEWLINE# flow_cls = flow . GRRFlow . GetPlugin ( flow_name ) #NEWLINE# if ( ( not flow_cls . ACL_ENFORCED ) or flow_cls . category ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise access_control . UnauthorizedAccess ( ( "Flow %s can't be started on a client by non-suid users." % flow_name ) )