gam7 7.6.13__py3-none-any.whl → 7.6.14__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gam7 might be problematic. Click here for more details.
- gam/__init__.py +44 -44
- {gam7-7.6.13.dist-info → gam7-7.6.14.dist-info}/METADATA +1 -1
- {gam7-7.6.13.dist-info → gam7-7.6.14.dist-info}/RECORD +6 -6
- {gam7-7.6.13.dist-info → gam7-7.6.14.dist-info}/WHEEL +0 -0
- {gam7-7.6.13.dist-info → gam7-7.6.14.dist-info}/entry_points.txt +0 -0
- {gam7-7.6.13.dist-info → gam7-7.6.14.dist-info}/licenses/LICENSE +0 -0
gam/__init__.py
CHANGED
|
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
|
|
25
25
|
"""
|
|
26
26
|
|
|
27
27
|
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
|
28
|
-
__version__ = '7.06.
|
|
28
|
+
__version__ = '7.06.14'
|
|
29
29
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
|
30
30
|
|
|
31
31
|
#pylint: disable=wrong-import-position
|
|
@@ -16497,8 +16497,10 @@ def getRoleId():
|
|
|
16497
16497
|
invalidChoiceExit(role, GM.Globals[GM.MAP_ROLE_NAME_TO_ID], True)
|
|
16498
16498
|
return (role, roleId)
|
|
16499
16499
|
|
|
16500
|
-
# gam create adminrole <String>
|
|
16501
|
-
#
|
|
16500
|
+
# gam create adminrole <String> [description <String>]
|
|
16501
|
+
# privileges all|all_ou|<PrivilegesList>|(select <FileSelector>|<CSVFileSelector>)
|
|
16502
|
+
# gam update adminrole <RoleItem> [name <String>] [description <String>]
|
|
16503
|
+
# [privileges all|all_ou|<PrivilegesList>|(select <FileSelector>|<CSVFileSelector>)]
|
|
16502
16504
|
def doCreateUpdateAdminRoles():
|
|
16503
16505
|
def expandChildPrivileges(privilege):
|
|
16504
16506
|
for childPrivilege in privilege.get('childPrivileges', []):
|
|
@@ -16529,8 +16531,12 @@ def doCreateUpdateAdminRoles():
|
|
|
16529
16531
|
elif privs == 'ALL_OU':
|
|
16530
16532
|
body['rolePrivileges'] = [{'privilegeName': p, 'serviceId': v} for p, v in ouPrivileges.items()]
|
|
16531
16533
|
else:
|
|
16534
|
+
if privs == 'SELECT':
|
|
16535
|
+
privsList = [p.upper() for p in getEntityList(Cmd.OB_PRIVILEGE_LIST)]
|
|
16536
|
+
else:
|
|
16537
|
+
privsList = privs.replace(',', ' ').split()
|
|
16532
16538
|
body.setdefault('rolePrivileges', [])
|
|
16533
|
-
for p in
|
|
16539
|
+
for p in privsList:
|
|
16534
16540
|
if p in allPrivileges:
|
|
16535
16541
|
body['rolePrivileges'].append({'privilegeName': p, 'serviceId': allPrivileges[p]})
|
|
16536
16542
|
elif p in ouPrivileges:
|
|
@@ -16540,6 +16546,8 @@ def doCreateUpdateAdminRoles():
|
|
|
16540
16546
|
elif ':' in p:
|
|
16541
16547
|
priv, serv = p.split(':')
|
|
16542
16548
|
body['rolePrivileges'].append({'privilegeName': priv, 'serviceId': serv.lower()})
|
|
16549
|
+
elif p == 'SUPPORT':
|
|
16550
|
+
pass
|
|
16543
16551
|
else:
|
|
16544
16552
|
invalidChoiceExit(p, list(allPrivileges.keys())+list(ouPrivileges.keys())+list(childPrivileges.keys()), True)
|
|
16545
16553
|
elif myarg == 'description':
|
|
@@ -16557,12 +16565,12 @@ def doCreateUpdateAdminRoles():
|
|
|
16557
16565
|
customer=GC.Values[GC.CUSTOMER_ID], body=body, fields='roleId,roleName')
|
|
16558
16566
|
else:
|
|
16559
16567
|
result = callGAPI(cd.roles(), 'patch',
|
|
16560
|
-
throwReasons=[GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND, GAPI.FORBIDDEN]+[GAPI.NOT_FOUND, GAPI.FAILED_PRECONDITION],
|
|
16568
|
+
throwReasons=[GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND, GAPI.FORBIDDEN]+[GAPI.NOT_FOUND, GAPI.FAILED_PRECONDITION, GAPI.CONFLICT],
|
|
16561
16569
|
customer=GC.Values[GC.CUSTOMER_ID], roleId=roleId, body=body, fields='roleId,roleName')
|
|
16562
16570
|
entityActionPerformed([Ent.ADMIN_ROLE, f"{result['roleName']}({result['roleId']})"])
|
|
16563
16571
|
except GAPI.duplicate as e:
|
|
16564
16572
|
entityActionFailedWarning([Ent.ADMIN_ROLE, f"{body['roleName']}"], str(e))
|
|
16565
|
-
except (GAPI.notFound, GAPI.forbidden, GAPI.failedPrecondition) as e:
|
|
16573
|
+
except (GAPI.notFound, GAPI.forbidden, GAPI.failedPrecondition, GAPI.conflict) as e:
|
|
16566
16574
|
entityActionFailedWarning([Ent.ADMIN_ROLE, roleId], str(e))
|
|
16567
16575
|
except (GAPI.badRequest, GAPI.customerNotFound):
|
|
16568
16576
|
accessErrorExit(cd)
|
|
@@ -16605,61 +16613,53 @@ def _showAdminRole(role, i=0, count=0):
|
|
|
16605
16613
|
Ind.Decrement()
|
|
16606
16614
|
|
|
16607
16615
|
# gam info adminrole <RoleItem> [privileges]
|
|
16608
|
-
def doInfoAdminRole():
|
|
16609
|
-
cd = buildGAPIObject(API.DIRECTORY)
|
|
16610
|
-
fieldsList = PRINT_ADMIN_ROLES_FIELDS[:]
|
|
16611
|
-
_, roleId = getRoleId()
|
|
16612
|
-
while Cmd.ArgumentsRemaining():
|
|
16613
|
-
myarg = getArgument()
|
|
16614
|
-
if myarg == 'privileges':
|
|
16615
|
-
fieldsList.append('rolePrivileges')
|
|
16616
|
-
else:
|
|
16617
|
-
unknownArgumentExit()
|
|
16618
|
-
fields = getFieldsFromFieldsList(fieldsList)
|
|
16619
|
-
try:
|
|
16620
|
-
role = callGAPI(cd.roles(), 'get',
|
|
16621
|
-
throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.FAILED_PRECONDITION,
|
|
16622
|
-
GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND],
|
|
16623
|
-
customer=GC.Values[GC.CUSTOMER_ID], roleId=roleId, fields=fields)
|
|
16624
|
-
role.setdefault('isSuperAdminRole', False)
|
|
16625
|
-
role.setdefault('isSystemRole', False)
|
|
16626
|
-
_showAdminRole(role)
|
|
16627
|
-
except (GAPI.notFound, GAPI.forbidden, GAPI.failedPrecondition) as e:
|
|
16628
|
-
entityActionFailedWarning([Ent.ADMIN_ROLE, roleId], str(e))
|
|
16629
|
-
except (GAPI.badRequest, GAPI.customerNotFound):
|
|
16630
|
-
accessErrorExit(cd)
|
|
16631
|
-
|
|
16632
16616
|
# gam print adminroles|roles [todrive <ToDriveAttribute>*]
|
|
16633
|
-
# [privileges] [oneitemperrow]
|
|
16634
|
-
# gam show adminroles|roles
|
|
16635
|
-
|
|
16617
|
+
# [role <RoleItem>] [privileges] [oneitemperrow]
|
|
16618
|
+
# gam show adminroles|roles
|
|
16619
|
+
# [role <RoleItem>] [privileges]
|
|
16620
|
+
def doInfoPrintShowAdminRoles():
|
|
16636
16621
|
cd = buildGAPIObject(API.DIRECTORY)
|
|
16637
16622
|
fieldsList = PRINT_ADMIN_ROLES_FIELDS[:]
|
|
16638
16623
|
csvPF = CSVPrintFile(fieldsList, PRINT_ADMIN_ROLES_FIELDS) if Act.csvFormat() else None
|
|
16639
16624
|
oneItemPerRow = False
|
|
16625
|
+
if Act.Get() != Act.INFO:
|
|
16626
|
+
roleId = None
|
|
16627
|
+
else:
|
|
16628
|
+
_, roleId = getRoleId()
|
|
16640
16629
|
while Cmd.ArgumentsRemaining():
|
|
16641
16630
|
myarg = getArgument()
|
|
16642
16631
|
if csvPF and myarg == 'todrive':
|
|
16643
16632
|
csvPF.GetTodriveParameters()
|
|
16633
|
+
elif roleId is None and myarg == 'role':
|
|
16634
|
+
_, roleId = getRoleId()
|
|
16644
16635
|
elif myarg == 'privileges':
|
|
16645
16636
|
fieldsList.append('rolePrivileges')
|
|
16646
16637
|
elif myarg == 'oneitemperrow':
|
|
16647
16638
|
oneItemPerRow = True
|
|
16648
16639
|
else:
|
|
16649
16640
|
unknownArgumentExit()
|
|
16650
|
-
if csvPF:
|
|
16641
|
+
if csvPF and 'rolePrivileges' in fieldsList:
|
|
16651
16642
|
if not oneItemPerRow:
|
|
16652
16643
|
csvPF.AddTitles(['rolePrivileges'])
|
|
16653
16644
|
else:
|
|
16654
16645
|
csvPF.AddTitles(['privilegeName', 'serviceId'])
|
|
16655
|
-
fields = getItemFieldsFromFieldsList('items', fieldsList)
|
|
16656
|
-
printGettingAllAccountEntities(Ent.ADMIN_ROLE)
|
|
16657
16646
|
try:
|
|
16658
|
-
|
|
16659
|
-
|
|
16660
|
-
|
|
16661
|
-
|
|
16662
|
-
|
|
16647
|
+
if roleId is None:
|
|
16648
|
+
fields = getItemFieldsFromFieldsList('items', fieldsList)
|
|
16649
|
+
printGettingAllAccountEntities(Ent.ADMIN_ROLE)
|
|
16650
|
+
roles = callGAPIpages(cd.roles(), 'list', 'items',
|
|
16651
|
+
pageMessage=getPageMessage(),
|
|
16652
|
+
throwReasons=[GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND, GAPI.FORBIDDEN],
|
|
16653
|
+
customer=GC.Values[GC.CUSTOMER_ID], fields=fields)
|
|
16654
|
+
else:
|
|
16655
|
+
fields = getFieldsFromFieldsList(fieldsList)
|
|
16656
|
+
roles = [callGAPI(cd.roles(), 'get',
|
|
16657
|
+
throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.FAILED_PRECONDITION,
|
|
16658
|
+
GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND],
|
|
16659
|
+
customer=GC.Values[GC.CUSTOMER_ID], roleId=roleId, fields=fields)]
|
|
16660
|
+
except (GAPI.notFound, GAPI.forbidden, GAPI.failedPrecondition) as e:
|
|
16661
|
+
entityActionFailedWarning([Ent.ADMIN_ROLE, roleId], str(e))
|
|
16662
|
+
except (GAPI.badRequest, GAPI.customerNotFound):
|
|
16663
16663
|
accessErrorExit(cd)
|
|
16664
16664
|
for role in roles:
|
|
16665
16665
|
role.setdefault('isSuperAdminRole', False)
|
|
@@ -75613,7 +75613,7 @@ MAIN_COMMANDS_WITH_OBJECTS = {
|
|
|
75613
75613
|
),
|
|
75614
75614
|
'info':
|
|
75615
75615
|
(Act.INFO,
|
|
75616
|
-
{Cmd.ARG_ADMINROLE:
|
|
75616
|
+
{Cmd.ARG_ADMINROLE: doInfoPrintShowAdminRoles,
|
|
75617
75617
|
Cmd.ARG_ALERT: doInfoAlert,
|
|
75618
75618
|
Cmd.ARG_ALIAS: doInfoAliases,
|
|
75619
75619
|
Cmd.ARG_BUILDING: doInfoBuilding,
|
|
@@ -75688,7 +75688,7 @@ MAIN_COMMANDS_WITH_OBJECTS = {
|
|
|
75688
75688
|
'print':
|
|
75689
75689
|
(Act.PRINT,
|
|
75690
75690
|
{Cmd.ARG_ADDRESSES: doPrintAddresses,
|
|
75691
|
-
Cmd.ARG_ADMINROLE:
|
|
75691
|
+
Cmd.ARG_ADMINROLE: doInfoPrintShowAdminRoles,
|
|
75692
75692
|
Cmd.ARG_ADMIN: doPrintShowAdmins,
|
|
75693
75693
|
Cmd.ARG_ALERT: doPrintShowAlerts,
|
|
75694
75694
|
Cmd.ARG_ALERTFEEDBACK: doPrintShowAlertFeedback,
|
|
@@ -75821,7 +75821,7 @@ MAIN_COMMANDS_WITH_OBJECTS = {
|
|
|
75821
75821
|
),
|
|
75822
75822
|
'show':
|
|
75823
75823
|
(Act.SHOW,
|
|
75824
|
-
{Cmd.ARG_ADMINROLE:
|
|
75824
|
+
{Cmd.ARG_ADMINROLE: doInfoPrintShowAdminRoles,
|
|
75825
75825
|
Cmd.ARG_ADMIN: doPrintShowAdmins,
|
|
75826
75826
|
Cmd.ARG_ALERT: doPrintShowAlerts,
|
|
75827
75827
|
Cmd.ARG_ALERTFEEDBACK: doPrintShowAlertFeedback,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
gam/__init__.py,sha256=
|
|
1
|
+
gam/__init__.py,sha256=tqFnE0dQXTWJ4dRdDjHygddy5wvRaWrl6aNHzL1AtIA,3495775
|
|
2
2
|
gam/__main__.py,sha256=amz0-959ph6zkZKqjaar4n60yho-T37w6qWI36qx0CA,1049
|
|
3
3
|
gam/cacerts.pem,sha256=nJuWha0xm5dHw_5ptGphwRoO-r36Ccpqiww9pCEDbSc,67484
|
|
4
4
|
gam/cbcm-v1.1beta1.json,sha256=xO5XloCQQULmPbFBx5bckdqmbLFQ7sJ2TImhE1ysDIY,19439
|
|
@@ -65,8 +65,8 @@ gam/googleapiclient/discovery_cache/base.py,sha256=yCDPtxnbNN-p5_9fzBacC6P3wcUPl
|
|
|
65
65
|
gam/googleapiclient/discovery_cache/file_cache.py,sha256=sim3Mg4HgRYo3vX75jvcKy_aV568EvIrtBfvfbw-044,4774
|
|
66
66
|
gam/iso8601/__init__.py,sha256=Z2PsYbXgAH5a5xzUvgczCboPzqWpm65kRcIngCnhViU,1218
|
|
67
67
|
gam/iso8601/iso8601.py,sha256=Li2FHZ4sBTWuthuQhyCvmvj0j6At8JbGzkSv2fc2RHU,4384
|
|
68
|
-
gam7-7.6.
|
|
69
|
-
gam7-7.6.
|
|
70
|
-
gam7-7.6.
|
|
71
|
-
gam7-7.6.
|
|
72
|
-
gam7-7.6.
|
|
68
|
+
gam7-7.6.14.dist-info/METADATA,sha256=lmYxagjYKa44rO1m2o0CcQYbpAH418qA2GAERpB4Btw,2970
|
|
69
|
+
gam7-7.6.14.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
70
|
+
gam7-7.6.14.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
|
|
71
|
+
gam7-7.6.14.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
72
|
+
gam7-7.6.14.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|