mirror of
https://github.com/GAM-team/GAM.git
synced 2025-07-08 13:43:35 +00:00
'gam license <sku>' to perform actions for users with given skus
This commit is contained in:
11
gam.py
11
gam.py
@ -6387,10 +6387,9 @@ def doPrintCrosDevices():
|
|||||||
cros_attributes.append(crosdevice)
|
cros_attributes.append(crosdevice)
|
||||||
output_csv(cros_attributes, titles, 'CrOS', todrive)
|
output_csv(cros_attributes, titles, 'CrOS', todrive)
|
||||||
|
|
||||||
def doPrintLicenses(return_list=False):
|
def doPrintLicenses(return_list=False, skus=None):
|
||||||
lic = buildGAPIObject(u'licensing')
|
lic = buildGAPIObject(u'licensing')
|
||||||
products = [u'Google-Apps', u'Google-Drive-storage', u'Google-Coordinate', u'Google-Vault']
|
products = [u'Google-Apps', u'Google-Drive-storage', u'Google-Coordinate', u'Google-Vault']
|
||||||
skus = None
|
|
||||||
licenses = []
|
licenses = []
|
||||||
lic_attributes = [{}]
|
lic_attributes = [{}]
|
||||||
todrive = False
|
todrive = False
|
||||||
@ -6963,6 +6962,14 @@ def getUsersToModify(entity_type=None, entity=None, silent=False, return_uids=Fa
|
|||||||
else:
|
else:
|
||||||
users.append(member[u'primaryEmail'])
|
users.append(member[u'primaryEmail'])
|
||||||
if not silent: sys.stderr.write(u"done.\r\n")
|
if not silent: sys.stderr.write(u"done.\r\n")
|
||||||
|
elif entity_type in [u'license', u'licenses']:
|
||||||
|
users = []
|
||||||
|
licenses = doPrintLicenses(return_list=True, skus=entity.split(u','))
|
||||||
|
for row in licenses[1:]: # skip header
|
||||||
|
try:
|
||||||
|
users.append(row[u'userId'])
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
elif entity_type == u'file':
|
elif entity_type == u'file':
|
||||||
users = []
|
users = []
|
||||||
filename = entity
|
filename = entity
|
||||||
|
Reference in New Issue
Block a user