-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated
gam <UserTypeEntity> update serviceaccount
to properly set the readonly scope for `[R] 35) Meet API (supports readonly)` as it is a special case.
- Loading branch information
Showing
4 changed files
with
17 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
""" | ||
|
||
__author__ = 'GAM Team <[email protected]>' | ||
__version__ = '7.00.39' | ||
__version__ = '7.00.40' | ||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)' | ||
|
||
#pylint: disable=wrong-import-position | ||
|
@@ -10550,7 +10550,7 @@ def getScopesFromUser(scopesList, clientAccess, currentScopes=None): | |
selectedScopes[i] = '*' | ||
break | ||
if 'readonly' in a_scope['subscopes']: | ||
if scope == possibleScope+'.readonly': | ||
if (scope == possibleScope+'.readonly') or (scope == a_scope.get('roscope')): | ||
selectedScopes[i] = 'R' | ||
break | ||
i += 1 | ||
|
@@ -12140,8 +12140,12 @@ def authorizeScopes(message): | |
checkScopesSet.add(scope['scope']) | ||
elif selectedScopes[i] == 'R': | ||
saScopes.setdefault(scope['api'], []) | ||
saScopes[scope['api']].append(f'{scope["scope"]}.readonly') | ||
checkScopesSet.add(f'{scope["scope"]}.readonly') | ||
if 'roscope' not in scope: | ||
saScopes[scope['api']].append(f'{scope["scope"]}.readonly') | ||
checkScopesSet.add(f'{scope["scope"]}.readonly') | ||
else: | ||
saScopes[scope['api']].append(scope['roscope']) | ||
checkScopesSet.add(scope['roscope']) | ||
i += 1 | ||
if API.DRIVEACTIVITY in saScopes and API.DRIVE3 in saScopes: | ||
saScopes[API.DRIVEACTIVITY].append(API.DRIVE_SCOPE) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters