mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 12:21:35 +00:00
Added option shareddrives to gam print shareddriveorganizers
This commit is contained in:
@@ -4820,7 +4820,8 @@ gam show shareddrives
|
|||||||
[formatjson] [noorgunits [<Boolean>]]
|
[formatjson] [noorgunits [<Boolean>]]
|
||||||
|
|
||||||
gam print shareddriveorganizers [todrive <ToDriveAttribute>*]
|
gam print shareddriveorganizers [todrive <ToDriveAttribute>*]
|
||||||
[shareddriveadminquery|query <QuerySharedDrive>]
|
[(shareddriveadminquery|query <QuerySharedDrive>) |
|
||||||
|
(shareddrives|teamdrives (<SharedDriveIDList>|(select <FileSelector>|<CSVFileSelector>)))]
|
||||||
[orgunit|org|ou <OrgUnitPath>]
|
[orgunit|org|ou <OrgUnitPath>]
|
||||||
[matchname <REMatchPattern>]
|
[matchname <REMatchPattern>]
|
||||||
[domainlist <DomainList>]
|
[domainlist <DomainList>]
|
||||||
@@ -8337,7 +8338,9 @@ gam <UserTypeEntity> show shareddrives
|
|||||||
[formatjson]
|
[formatjson]
|
||||||
|
|
||||||
gam <UserTypeEntity> print shareddriveorganizers [todrive <ToDriveAttribute>*]
|
gam <UserTypeEntity> print shareddriveorganizers [todrive <ToDriveAttribute>*]
|
||||||
[adminaccess|asadmin] [shareddriveadminquery|query <QuerySharedDrive>]
|
[adminaccess|asadmin]
|
||||||
|
[(shareddriveadminquery|query <QuerySharedDrive>) |
|
||||||
|
(shareddrives|teamdrives (<SharedDriveIDList>|(select <FileSelector>|<CSVFileSelector>)))]
|
||||||
[orgunit|org|ou <OrgUnitPath>]
|
[orgunit|org|ou <OrgUnitPath>]
|
||||||
[matchname <REMatchPattern>]
|
[matchname <REMatchPattern>]
|
||||||
[domainlist <DomainList>]
|
[domainlist <DomainList>]
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
7.08.01
|
||||||
|
|
||||||
|
Added option `shareddrives (<SharedDriveIDList>|(select <FileSelector>|<CSVFileSelector>))` to
|
||||||
|
`gam print shareddriveorganizers` that displays organizers for a specific list of Shared Drive IDs.
|
||||||
|
|
||||||
7.08.00
|
7.08.00
|
||||||
|
|
||||||
Added the following command that can be used instead of the `GetTeamDriveOrganizers.py` script.
|
Added the following command that can be used instead of the `GetTeamDriveOrganizers.py` script.
|
||||||
@@ -16,7 +21,7 @@ gam [<UserTypeEntity>] print shareddriveorganizers [todrive <ToDriveAttribute>*]
|
|||||||
```
|
```
|
||||||
The command defaults match the script defaults:
|
The command defaults match the script defaults:
|
||||||
* `domainlist` - All domains
|
* `domainlist` - All domains
|
||||||
* `includetypes` - user,groups
|
* `includetypes` - user,group
|
||||||
* `oneorganizer` - False
|
* `oneorganizer` - False
|
||||||
* `shownoorganizerdrives` - True
|
* `shownoorganizerdrives` - True
|
||||||
* `includefileorganizers` - False
|
* `includefileorganizers` - False
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
||||||
__version__ = '7.08.00'
|
__version__ = '7.08.01'
|
||||||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
||||||
|
|
||||||
#pylint: disable=wrong-import-position
|
#pylint: disable=wrong-import-position
|
||||||
@@ -66053,7 +66053,9 @@ def doPrintShowSharedDriveACLs():
|
|||||||
PRINT_ORGANIZER_TYPES = {'group', 'user'}
|
PRINT_ORGANIZER_TYPES = {'group', 'user'}
|
||||||
|
|
||||||
# gam [<UserTypeEntity>] print shareddriveorganizers [todrive <ToDriveAttribute>*]
|
# gam [<UserTypeEntity>] print shareddriveorganizers [todrive <ToDriveAttribute>*]
|
||||||
# [adminaccess|asadmin] [shareddriveadminquery|query <QuerySharedDrive>]
|
# [adminaccess|asadmin]
|
||||||
|
# [(shareddriveadminquery|query <QuerySharedDrive>) |
|
||||||
|
# (shareddrives|teamdrives (<SharedDriveIDList>|(select <FileSelector>|<CSVFileSelector>)))]
|
||||||
# [matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>]
|
# [matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>]
|
||||||
# [domainlist <DomainList>]
|
# [domainlist <DomainList>]
|
||||||
# [includetypes user|group]
|
# [includetypes user|group]
|
||||||
@@ -66068,7 +66070,7 @@ def printSharedDriveOrganizers(users, useDomainAdminAccess=False):
|
|||||||
includeTypes = set()
|
includeTypes = set()
|
||||||
showNoOrganizerDrives = SHOW_NO_PERMISSIONS_DRIVES_CHOICE_MAP['false']
|
showNoOrganizerDrives = SHOW_NO_PERMISSIONS_DRIVES_CHOICE_MAP['false']
|
||||||
fieldsList = ['role', 'type', 'emailAddress']
|
fieldsList = ['role', 'type', 'emailAddress']
|
||||||
cd = orgUnitId = query = matchPattern = None
|
cd = entityList = orgUnitId = query = matchPattern = None
|
||||||
domainList = []
|
domainList = []
|
||||||
oneOrganizer = False
|
oneOrganizer = False
|
||||||
while Cmd.ArgumentsRemaining():
|
while Cmd.ArgumentsRemaining():
|
||||||
@@ -66077,7 +66079,15 @@ def printSharedDriveOrganizers(users, useDomainAdminAccess=False):
|
|||||||
csvPF.GetTodriveParameters()
|
csvPF.GetTodriveParameters()
|
||||||
elif myarg == 'delimiter':
|
elif myarg == 'delimiter':
|
||||||
delimiter = getCharacter()
|
delimiter = getCharacter()
|
||||||
|
elif myarg in {'shareddrive', 'shareddrives', 'teamdrive', 'teamdrives'}:
|
||||||
|
sharedDriveArg = myarg
|
||||||
|
itemList = getString(Cmd.OB_SHAREDDRIVE_ID_LIST)
|
||||||
|
if itemList != 'select':
|
||||||
|
entityList = itemList.replace(',', ' ').split()
|
||||||
|
else:
|
||||||
|
entityList = getEntityList(Cmd.OB_SHAREDDRIVE_ID_LIST)
|
||||||
elif myarg in {'teamdriveadminquery', 'shareddriveadminquery', 'query'}:
|
elif myarg in {'teamdriveadminquery', 'shareddriveadminquery', 'query'}:
|
||||||
|
queryArg = myarg
|
||||||
queryLocation = Cmd.Location()
|
queryLocation = Cmd.Location()
|
||||||
query = getString(Cmd.OB_QUERY, minLen=0) or None
|
query = getString(Cmd.OB_QUERY, minLen=0) or None
|
||||||
if query:
|
if query:
|
||||||
@@ -66110,9 +66120,13 @@ def printSharedDriveOrganizers(users, useDomainAdminAccess=False):
|
|||||||
roles.add('fileOrganizer')
|
roles.add('fileOrganizer')
|
||||||
else:
|
else:
|
||||||
unknownArgumentExit()
|
unknownArgumentExit()
|
||||||
if query and not useDomainAdminAccess:
|
if query:
|
||||||
|
if not useDomainAdminAccess:
|
||||||
Cmd.SetLocation(queryLocation-1)
|
Cmd.SetLocation(queryLocation-1)
|
||||||
usageErrorExit(Msg.ONLY_ADMINISTRATORS_CAN_PERFORM_SHARED_DRIVE_QUERIES)
|
usageErrorExit(Msg.ONLY_ADMINISTRATORS_CAN_PERFORM_SHARED_DRIVE_QUERIES)
|
||||||
|
if entityList:
|
||||||
|
Cmd.SetLocation(queryLocation-1)
|
||||||
|
usageErrorExit(Msg.ARE_MUTUALLY_EXCLUSIVE.format(queryArg, sharedDriveArg))
|
||||||
if orgUnitId is not None:
|
if orgUnitId is not None:
|
||||||
if not useDomainAdminAccess:
|
if not useDomainAdminAccess:
|
||||||
Cmd.SetLocation(orgLocation-1)
|
Cmd.SetLocation(orgLocation-1)
|
||||||
@@ -66127,6 +66141,7 @@ def printSharedDriveOrganizers(users, useDomainAdminAccess=False):
|
|||||||
user, drive = buildGAPIServiceObject(API.DRIVE3, user, i, count)
|
user, drive = buildGAPIServiceObject(API.DRIVE3, user, i, count)
|
||||||
if not drive:
|
if not drive:
|
||||||
continue
|
continue
|
||||||
|
if entityList is None:
|
||||||
if useDomainAdminAccess:
|
if useDomainAdminAccess:
|
||||||
printGettingAllAccountEntities(Ent.SHAREDDRIVE, query)
|
printGettingAllAccountEntities(Ent.SHAREDDRIVE, query)
|
||||||
pageMessage = getPageMessage()
|
pageMessage = getPageMessage()
|
||||||
@@ -66149,6 +66164,23 @@ def printSharedDriveOrganizers(users, useDomainAdminAccess=False):
|
|||||||
except (GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy) as e:
|
except (GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy) as e:
|
||||||
userDriveServiceNotEnabledWarning(user, str(e), i, count)
|
userDriveServiceNotEnabledWarning(user, str(e), i, count)
|
||||||
continue
|
continue
|
||||||
|
else:
|
||||||
|
feed = []
|
||||||
|
jcount = len(entityList)
|
||||||
|
j = 0
|
||||||
|
for driveId in entityList:
|
||||||
|
j +=1
|
||||||
|
try:
|
||||||
|
feed.append(callGAPI(drive.drives(), 'get',
|
||||||
|
throwReasons=GAPI.DRIVE_USER_THROW_REASONS+[GAPI.NOT_FOUND],
|
||||||
|
useDomainAdminAccess=useDomainAdminAccess,
|
||||||
|
driveId=driveId, fields='id,name,createdTime,orgUnitId'))
|
||||||
|
except (GAPI.fileNotFound, GAPI.notFound) as e:
|
||||||
|
entityActionNotPerformedWarning([Ent.USER, user, Ent.SHAREDDRIVE_ID, driveId], str(e), j, jcount)
|
||||||
|
continue
|
||||||
|
except (GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy) as e:
|
||||||
|
userDriveServiceNotEnabledWarning(user, str(e), i, count)
|
||||||
|
break
|
||||||
matchFeed = []
|
matchFeed = []
|
||||||
jcount = len(feed)
|
jcount = len(feed)
|
||||||
j = 0
|
j = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user