(20241128) Scopes check added.

This commit is contained in:
2024-11-28 13:07:47 +05:30
parent 6ca90bb25d
commit 1b61b6a9eb
3 changed files with 7 additions and 2 deletions
+7 -2
View File
@@ -207,7 +207,7 @@ class GoogleAuthTokens(BaseModel):
def has_scopes(self, scopes: List[str]) -> bool:
"""
Check if all the specified scopes were granted.
Checks if all the specified scopes were granted.
:param scopes: The list of scopes to check. These are the permissions you need.
:return: True if all specified scoped are present, else False.
"""
@@ -217,7 +217,12 @@ class GoogleAuthTokens(BaseModel):
# Now loop through the needed scopes and check:
for scope in scopes:
if scope not in self.scopes
if scope not in self.scopes:
has_scopes = False
break
# Done here:
return has_scopes
# *****************************************************************************************************************