Google Drive API: How do you insert permissions to make a document publicly readable?

可紊 提交于 2019-12-12 03:37:59

问题


I know that to add permissions to a specific user, you format a permissions resource like so:

new_permission = {
    'value': 'me@gmail.com',
    'type': 'user',
    'role': 'reader'
}

But, what if i want to grant read-only access to anyone? I guess, something like:

new_permission = {
    'type': 'anyone',
    'role': 'reader',
    'value': ???!
}

What do I put as 'value'?


回答1:


Well, it turns out that "value" is not required parameter for type=anyone.

new_permission = {
    'type': 'anyone',
    'role': 'reader'
}

works just fine.



来源:https://stackoverflow.com/questions/13322287/google-drive-api-how-do-you-insert-permissions-to-make-a-document-publicly-read

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!