mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-28 09:51:36 +00:00
Merge branch 'main' of https://github.com/GAM-team/GAM
This commit is contained in:
@@ -44907,10 +44907,15 @@ def getUserLicenses(lic, user, skus):
|
||||
licenses.append(response['skuId'])
|
||||
del sku_calls[request_id]
|
||||
else:
|
||||
if exception.reason == not_found:
|
||||
_, reason, _ = checkGAPIError(exception, softErrors=True)
|
||||
reasons_to_quit = [
|
||||
GAPI.ACCESS_NOT_CONFIGURED, # license API not turned on
|
||||
GAPI.PERMISSION_DENIED, # Admin doesn't have rights to license assignments
|
||||
GAPI.NOT_FOUND # API call succeeded, user does not have this license
|
||||
]
|
||||
if reason in reasons_to_quit:
|
||||
del sku_calls[request_id]
|
||||
|
||||
not_found = 'User does not have a license for specified sku and product'
|
||||
licenses = []
|
||||
svcargs = dict([('userId', user['primaryEmail']), ('productId', None), ('skuId', None), ('fields', 'skuId')]+GM.Globals[GM.EXTRA_ARGS_LIST])
|
||||
method = getattr(lic.licenseAssignments(), 'get')
|
||||
|
||||
Reference in New Issue
Block a user