Rclone lsjson file permissions

I am using lsjson -R to get google drive data in service account. It would be great if we could add permissions too with this like owner,editor etc. We can add a flag to print with permissions and without permissions.

hi, not sure what you need help with, what you wrote is a bit cryptic?
can you provide a real-world example?

the permissions are set at the time the service account is created, correct?

This is the command we run to get the files

.\rclone.exe lsjson --drive-impersonate admin@abccompany.com gdrive:/

Output We get

{"Path":"Testing.xlsx","Name":"testing.xlsx","Size":-1,"MimeType":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","ModTime":"2023-10-04T15:04:46.597Z","IsDir":false,"ID":"1xdPcdOeaSBAXz61k9if3iZAYVPDhNZjI_vYRk9jtu0c"}

Output we expect

I used google API Explorer to get the below output.

"permissions": [
{
"emailAddress": "abc@gmail.com",
"role": "writer"
},
{
"emailAddress": "user2@gmail.com",
"role": "writer"
}
]

We can add permissions in the first output like this

{"Path":"Testing.xlsx","Name":"testing.xlsx","Size":-1,"MimeType":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","ModTime":"2023-10-04T15:04:46.597Z","IsDir":false,"ID":"1xdPcdOeaSBAXz61k9if3iZAYVPDhNZjI_vYRk9jtu0c","permissions": [
{
"emailAddress": "abc@gmail.com",
"role": "writer"
},
{
"emailAddress": "user2@gmail.com",
"role": "writer"
}
]}

The above can be achieved with the same query rclone user with adding permission field in the query and some model changes of google drive.

This is in development at the moment.

See here for the latest code

https://beta.rclone.org/branch/fix-drive-metadata/

Use rclone lsjon -M

See also rclone help backend drive for updated docs.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.