Change permission from "editor" to "reader"

233 views
Skip to first unread message

Ryan Sousa

unread,
May 19, 2021, 10:56:12 AM5/19/21
to GAM for Google Workspace
I'm having trouble executing two commands.
1. Command to change permission of the file from editor to reader.  user "x" is as an editor in the drive file of user "y" who is the owner. I need to change the permission of the user "x" to reader.
Command: gam user y...@yyy.br add drivefileacl 1PadasdsadsadxxxxQWxqNwhHyg user x...@xxx.br role reader

Returns that works, but does not change the permission, the user remains as an "editor"

2. Command to remove all permissions on a file and leave only the owner.

Ross Scroggs

unread,
May 19, 2021, 12:27:44 PM5/19/21
to google-ap...@googlegroups.com
Ryan,

1:  You want update, not add
gam user y...@yyy.br update drivefileacl 1PadasdsadsadxxxxQWxqNwhHyg x...@xxx.br role reader

2. There is no command to do this, you'll have to list the ACLs and delete them individually.

Others have asked the same thing, I'll look into implemented such a command.

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/2a6c37c2-e70a-44f3-8614-0beebb7e6dbdn%40googlegroups.com.


--

Ryan Sousa

unread,
May 19, 2021, 1:10:39 PM5/19/21
to GAM for Google Workspace
Ross,

I already tried to update and it returns this error to me.

U:\>gam x...@xx.br update drivefileacl 1PUk0fnbogqU1Gld4EFqiFF-Xui-3Fslq2QWxqNwhHyg user y...@yy.br role reader
Command: gam user x...@xx.br update drivefileacl 1PUk0fnbogqU1Gld4EFqiFF-Xui-3Fslq2QWxqNwhHyg user >>>y...@yy.br<<< role reader

ERROR: Invalid argument
Help: Syntax in file D:\GAMADV-XTD3\GamCommands.txt

Ross Scroggs

unread,
May 19, 2021, 1:12:42 PM5/19/21
to google-ap...@googlegroups.com
Ryan,

You didn't enter the command as I showed, drop user from in front of x...@xxx.br
gam user y...@yyy.br update drivefileacl 1PadasdsadsadxxxxQWxqNwhHyg x...@xxx.br role reader

Ross



--

Ryan Sousa

unread,
May 19, 2021, 1:21:25 PM5/19/21
to GAM for Google Workspace
Ross,

Thank You.  It worked!!!

Ross Scroggs

unread,
May 19, 2021, 1:40:13 PM5/19/21
to google-ap...@googlegroups.com
Ryan,

2. Command to remove all permissions on a file and leave only the owner.

With Advanced GAM you would do:

gam user ow...@xxx.br print drivefileacls xxxx50ZyJD8-nBQ_BwIyudIzOs-MCvYHVhXu4Mzzzz oneitemperrow | gam config csv_input_row_drop_filter "permission.role:regex:owner" csv - gam user "~Owner" delete drivefileacl "~id" "id:~~permission.id~~"


Ross




--
Reply all
Reply to author
Forward
0 new messages