mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-29 18:31:38 +00:00
Updated gam <UserTypeEntity> print filelist ... showshareddrivepermissions
This commit is contained in:
@@ -53776,6 +53776,7 @@ def printFileList(users):
|
||||
csvPF.WriteRowTitlesJSONNoFilter(row)
|
||||
|
||||
def _printFileInfo(drive, user, f_file, cleanFileName):
|
||||
nonlocal getSharedDriveACLsCount, getSharedDriveACLsCountMsg
|
||||
driveId = f_file.get('driveId')
|
||||
checkSharedDrivePermissions = getPermissionsForSharedDrives and driveId and 'permissions' not in f_file
|
||||
if (f_file.get('noDisplay', False) or
|
||||
@@ -53789,6 +53790,10 @@ def printFileList(users):
|
||||
(DLP.onlySharedDrives and not driveId)):
|
||||
return
|
||||
if checkSharedDrivePermissions:
|
||||
if not incrementalPrint:
|
||||
getSharedDriveACLsCount += 1
|
||||
if getSharedDriveACLsCount % 100 == 0:
|
||||
writeStderr(f'{Msg.GOT} {getSharedDriveACLsCount} {getSharedDriveACLsCountMsg}')
|
||||
try:
|
||||
f_file['permissions'] = callGAPIpages(drive.permissions(), 'list', 'permissions',
|
||||
throwReasons=GAPI.DRIVE3_GET_ACL_REASONS,
|
||||
@@ -54053,6 +54058,7 @@ def printFileList(users):
|
||||
elif myarg == 'showshareddrivepermissions':
|
||||
getPermissionsForSharedDrives = True
|
||||
permissionsFields = f'nextPageToken,permissions({",".join(DRIVEFILE_BASIC_PERMISSION_FIELDS)})'
|
||||
getSharedDriveACLsCountMsg = f'{Ent.Plural(Ent.DRIVE_FILE_OR_FOLDER_ACL)} {Msg.FOR} {Ent.Plural(Ent.SHAREDDRIVE)}\n'
|
||||
elif myarg == 'pmfilter':
|
||||
pmselect = False
|
||||
elif myarg == 'oneitemperrow':
|
||||
@@ -54198,6 +54204,7 @@ def printFileList(users):
|
||||
filePathInfo = initFilePathInfo(pathDelimiter)
|
||||
filesPrinted = set()
|
||||
mimeTypeInfo = {}
|
||||
getSharedDriveACLsCount = 0
|
||||
if buildTree:
|
||||
printGettingAllEntityItemsForWhom(Ent.DRIVE_FILE_OR_FOLDER, user, i, count, query=DLP.fileIdEntity['query'])
|
||||
if not incrementalPrint:
|
||||
|
||||
Reference in New Issue
Block a user