(20241128) Scopes check added.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
# *****************************************************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user