(20241128) Files upgraded.
This commit is contained in:
@@ -204,6 +204,21 @@ class GoogleAuthTokens(BaseModel):
|
||||
force_refresh = force_refresh
|
||||
)
|
||||
|
||||
def has_scopes(self, scopes: List[str]) -> bool:
|
||||
|
||||
"""
|
||||
Check 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.
|
||||
"""
|
||||
|
||||
# Start by assuming success:
|
||||
has_scopes = True
|
||||
|
||||
# Now loop through the needed scopes and check:
|
||||
for scope in scopes:
|
||||
if scope not in self.scopes
|
||||
|
||||
|
||||
# *****************************************************************************************************************
|
||||
# ***** ****
|
||||
|
||||
Reference in New Issue
Block a user