File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -369,24 +369,17 @@ def who_can(
369369 for identity in gaad .RoleDetailList + gaad .UserDetailList :
370370 sources .add (identity .Arn )
371371
372- solver = self .generate_solver (
373- source = list (sources ),
374- action = action ,
375- resource = resource ,
376- conditions = conditions ,
377- condition_file = condition_file ,
378- strict_conditions = strict_conditions ,
379- )
380-
381- sat = solver .check () == z3 .sat
382- while sat :
383- s = z3 .String ("s" )
384- m = solver .model ()
385- source = m [s ]
386- logger .debug (f"Found { source } as a potential candidate" )
387- yield self .get_correct_case_principal (str (source )[1 :- 1 ])
388- solver .add (s != source )
389- sat = solver .check () == z3 .sat
372+ for source in sources :
373+ if self .can_i (
374+ source = source ,
375+ action = action ,
376+ resource = resource ,
377+ conditions = conditions ,
378+ condition_file = condition_file ,
379+ strict_conditions = strict_conditions ,
380+ ):
381+ logger .debug (f"Found { source } as a potential candidate" )
382+ yield source
390383
391384 def which_can_i (
392385 self ,
You can’t perform that action at this time.
0 commit comments