| Index: appengine/findit/waterfall/flake/flake_analysis_service.py
|
| diff --git a/appengine/findit/waterfall/flake/flake_analysis_service.py b/appengine/findit/waterfall/flake/flake_analysis_service.py
|
| index b1ba62540f50da745f723a1252922e5bca375034..5bf59375eb5ee047b8def11768fb144b630ea2da 100644
|
| --- a/appengine/findit/waterfall/flake/flake_analysis_service.py
|
| +++ b/appengine/findit/waterfall/flake/flake_analysis_service.py
|
| @@ -169,11 +169,11 @@ def _CheckForNewAnalysis(request):
|
| return _MergeNewRequestIntoExistingOne(request, previous_request)
|
|
|
|
|
| -def _IsAuthorizedUser(user_email):
|
| - """Returns True if the given user email account is authorized for access."""
|
| - return user_email and (
|
| +def IsAuthorizedUser(user_email, is_admin):
|
| + """Returns True if the given user email account is authorized for access."""
|
| + return is_admin or (user_email and (
|
| user_email in constants.WHITELISTED_APP_ACCOUNTS or
|
| - user_email.endswith('@google.com'))
|
| + user_email.endswith('@google.com')))
|
|
|
|
|
| def ScheduleAnalysisForFlake(request, user_email, is_admin):
|
| @@ -190,7 +190,7 @@ def ScheduleAnalysisForFlake(request, user_email, is_admin):
|
| """
|
| assert len(request.build_steps) > 0, 'At least 1 build step is needed!'
|
|
|
| - if not is_admin and not _IsAuthorizedUser(user_email):
|
| + if not IsAuthorizedUser(user_email, is_admin):
|
| return None
|
| request.user_emails = [user_email]
|
|
|
|
|