taers232c / GAMADV-XTD3

Command line tool to manage Google Workspace
691 stars 86 forks source link

listing files using "onlyshareddrives" does not output records if user is not a member of the drive directly #355

Closed FluXs closed 1 month ago

FluXs commented 1 year ago

Hi there

I am using the below command to locate files that have been specifically shared with a user in shared drives (I then intend to filter out inherited permission matches)

However, the command does not seem to output any information despite finding matches.

gam user xxx@domain.com print filelist choose onlyshareddrives showdrivename showshareddrivepermissions

Result:

Getting all Drive Files/Folders for xxx@domain.com
Got 9 Drive Files/Folders for xxx@domain.com...
Owner,name,webViewLink

In this test, the user I am checking against is not a Drive member of the shared drive itself. When adding the user as a Drive Member, the same 9 files are detected and will show in the output... however, the need for the user to be a drive member was not my understanding of how this option would work

In addition, if I change this choice to any other type of value such as "sharedwithme_notmydrive" I get no results unless I use the "alldrives" option:

gam user xxx@domain.com print filelist choose alldrives showdrivename showshareddrivepermissions

Note: For reference, this is a test user so they have no existing files shared with them (apart from files within the demo shared drive subfolder)

I was running: v6.53.02 and have updated to v6.57.04 and this behavior still persists.

If this is the intended behavior please let me know and I will just proceed to the search on "alldrives" and filter out none shared drive matches. But hopefully, I have found a bug :)

Thanks

taers232c commented 1 year ago

Mark,

Send me a Meet/Zoom invitation and we'll discuss.

The command is run from the user's perspective, if the user is not a member of a shared drive, then the files on that drive are not visible.

You can run the command as a Shared Drive organizer and do a permission match. gam user @. print filelist select teamdriveid fields id,name,permissions pm emailaddress @. em pmfilter

Ross


Ross Scroggs @.***

On Apr 22, 2023, at 6:53 AM, Mark @.***> wrote:

Hi there

I am using the below command to locate files that have been specifically shared with a user in shared drives (I then intend to filter out inherited permission matches)

However, the command does not seem to output any information despite finding matches.

gam user @.*** print filelist choose onlyshareddrives showdrivename showshareddrivepermissions

Result:

Getting all Drive Files/Folders for @. Got 9 Drive Files/Folders for @. Owner,name,webViewLink In this test, the user I am checking against is not a Drive member of the shared drive itself. When adding the user as a Drive Member, the same 9 files are detected and will show in the output... however, the need for the user to be a drive member was not my understanding of how this option would work

In addition, if I change this choice to any other type of value such as "sharedwithme_notmydrive" I get no results unless I use the "alldrives" option:

gam user @.*** print filelist choose alldrives showdrivename showshareddrivepermissions

Note: For reference, this is a test user so they have no existing files shared with them (apart from files within the demo shared drive subfolder)

I was running: v6.53.02 and have updated to v6.57.04 and this behavior still persists.

If this is the intended behavior please let me know and I will just proceed to the search on "alldrives" and filter out none shared drive matches. But hopefully, I have found a bug :)

Thanks

— Reply to this email directly, view it on GitHub https://github.com/taers232c/GAMADV-XTD3/issues/355, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL6PXW3PILWJ663IRS3XCPPFJANCNFSM6AAAAAAXH3J3LE. You are receiving this because you are subscribed to this thread.

taers232c commented 1 year ago

Mark,

See: https://github.com/taers232c/GAM-Scripts3/blob/master/GetSharedWithUserTeamDriveACLs.py

Ross

Ross Scroggs @.***

On Apr 22, 2023, at 6:53 AM, Mark @.***> wrote:

Hi there

I am using the below command to locate files that have been specifically shared with a user in shared drives (I then intend to filter out inherited permission matches)

However, the command does not seem to output any information despite finding matches.

gam user @.*** print filelist choose onlyshareddrives showdrivename showshareddrivepermissions

Result:

Getting all Drive Files/Folders for @. Got 9 Drive Files/Folders for @. Owner,name,webViewLink In this test, the user I am checking against is not a Drive member of the shared drive itself. When adding the user as a Drive Member, the same 9 files are detected and will show in the output... however, the need for the user to be a drive member was not my understanding of how this option would work

In addition, if I change this choice to any other type of value such as "sharedwithme_notmydrive" I get no results unless I use the "alldrives" option:

gam user @.*** print filelist choose alldrives showdrivename showshareddrivepermissions

Note: For reference, this is a test user so they have no existing files shared with them (apart from files within the demo shared drive subfolder)

I was running: v6.53.02 and have updated to v6.57.04 and this behavior still persists.

If this is the intended behavior please let me know and I will just proceed to the search on "alldrives" and filter out none shared drive matches. But hopefully, I have found a bug :)

Thanks

— Reply to this email directly, view it on GitHub https://github.com/taers232c/GAMADV-XTD3/issues/355, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL6PXW3PILWJ663IRS3XCPPFJANCNFSM6AAAAAAXH3J3LE. You are receiving this because you are subscribed to this thread.

taers232c commented 1 year ago

Mark,

See: https://developers.google.com/drive/api/v3/reference/files/list

Scrool down to corpora: Groupings of files to which the query applies. Supported groupings are: 'user' (files created by, opened by, or shared directly with the user), 'drive' (files in the specified shared drive as indicated by the 'driveId'), 'domain' (files shared to the user's domain), and 'allDrives' (A combination of 'user' and 'drive' for all drives where the user is a member). When able, use 'user' or 'drive', instead of 'allDrives', for efficiency.

Ross

Ross Scroggs @.***

On Apr 22, 2023, at 6:53 AM, Mark @.***> wrote:

Hi there

I am using the below command to locate files that have been specifically shared with a user in shared drives (I then intend to filter out inherited permission matches)

However, the command does not seem to output any information despite finding matches.

gam user @.*** print filelist choose onlyshareddrives showdrivename showshareddrivepermissions

Result:

Getting all Drive Files/Folders for @. Got 9 Drive Files/Folders for @. Owner,name,webViewLink In this test, the user I am checking against is not a Drive member of the shared drive itself. When adding the user as a Drive Member, the same 9 files are detected and will show in the output... however, the need for the user to be a drive member was not my understanding of how this option would work

In addition, if I change this choice to any other type of value such as "sharedwithme_notmydrive" I get no results unless I use the "alldrives" option:

gam user @.*** print filelist choose alldrives showdrivename showshareddrivepermissions

Note: For reference, this is a test user so they have no existing files shared with them (apart from files within the demo shared drive subfolder)

I was running: v6.53.02 and have updated to v6.57.04 and this behavior still persists.

If this is the intended behavior please let me know and I will just proceed to the search on "alldrives" and filter out none shared drive matches. But hopefully, I have found a bug :)

Thanks

— Reply to this email directly, view it on GitHub https://github.com/taers232c/GAMADV-XTD3/issues/355, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL6PXW3PILWJ663IRS3XCPPFJANCNFSM6AAAAAAXH3J3LE. You are receiving this because you are subscribed to this thread.