How to let anonymous users edit a Google Drive Realtime document?

。_饼干妹妹 提交于 2019-12-07 04:59:12

问题


I want to create a web page that uses Google Drive Realtime API that allows users to anonymously edit several text fields. Because more than one user may be accessing the page simultaneously, I want to prevent someone's edit from being overwritten by another user without the first editor knowing that his edit is overwritten.

However, from the quick start, it seems that authorization using Google Account is needed for people to start editing. Is it possible to let arbritrary user edit my realtime model, without the need of logging in? Something similar to letting a Google Docs Spreadsheet be edited by the public.


回答1:


Right now only psuedo-anonymous mode is available. You can make files available publicly, or to anyone with a link. However, the user will need to log in with a Google account in order to edit.

They appear as an anonymous user to the other users in the document. This is where isAnonymous is currently used.




回答2:


I have confirmed that this is possible. Right click the document in Google Drive, and click Share... In the dialog that opens, click the drop down and select Anyone with the link can edit. Give the shareable link to whomever you need and they will be able to edit.




回答3:


From a brief look at the documentation it may be available however I was unable to find anything allowing anonymous users (it seemed to require oAuth 2.0 with G+ to work). In regards to your second part, controlling users editing parts based on consent is going to get very quickly and I am unsure if you would be able to do it easily. If you want features as complex as these you may just have to implement your own realtime editing features (or try and leverage the google realtime api in some indirect way.



来源:https://stackoverflow.com/questions/16642598/how-to-let-anonymous-users-edit-a-google-drive-realtime-document

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