Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: "anyone with the link can view" permission #568

Closed
RickCogley opened this issue Jan 26, 2016 · 8 comments
Closed

Question: "anyone with the link can view" permission #568

RickCogley opened this issue Jan 26, 2016 · 8 comments
Milestone

Comments

@RickCogley
Copy link

Hi - how could I set "anyone with the link can view" permission like in the inline screenshot below? The drive share command seems to be email-centric. Please advise, thanks.

jrc screenshot 2016-01-26 at 11 29 14 pm

@clawoflight
Copy link

Use drive pub.

@RickCogley
Copy link
Author

Hi @clawoflight, thanks. drive pub makes the link public, which google says is indexed. The above setting is apparently different from that, in that it is not indexed.

@odeke-em
Copy link
Owner

odeke-em commented Feb 4, 2016

Hello again @RickCogley. Unfortunately drive pub is the only way right now. I didn't know about this nor how to solve this currently. Any doc references?

@RickCogley
Copy link
Author

I looked at the API docs, but, I cannot see anything specific about those two settings which are available in the GUI itself. @odeke-em

@thebaddie
Copy link

Here's what's needed: https://developers.google.com/drive/v3/reference/permissions#resource-representations

type: "anyone"
role: "reader"
allowFileDiscovery: false

It would be very usefull to add the "anyone with the link" feature

@odeke-em
Copy link
Owner

Aha I finally now understand the problem. Thank you @thebaddie for rephrasing it and thank you @RickCogley for advocating it, I have been able to locally produce the expected output. PR coming shortly.

@odeke-em odeke-em added this to the v0.3.7 milestone May 19, 2016
odeke-em added a commit that referenced this issue May 19, 2016
Allow sharing of file with `anyone with link` without
having to publish it to the internet. Publishing is different
because after a file is published, it is indexed
(See #568 (comment)).
We don't want the file to be indexed, but just accessible by anyone with
a link to it.

```shell
$ drive share --type user,anyone,anyone,user --role reader,anyone --emails "emm.odeke@gmail.com" outf.gif
Provide access for accountType(s)
  user
  anyone

For roles(s)
  reader

Addressees:
  + emm.odeke@gmail.com
  + Anyone with the link

File(s) to share:
  + outf.gif

Proceed with the changes? [Y/n]:y
successful share for outf.gif with email "emm.odeke@gmail.com", role "reader" accountType "user"
successful share for outf.gif with email "", role "reader" accountType "anyone"
```

Fixes #568.
@odeke-em
Copy link
Owner

Hey folks. Thank you very much for the patience. I finally got time and thought about it. After re-reading the content in the issue I was able to discover how to solve it. The hints and discussions helped a lot. I learnt something about published files being indexed (which is not want the user wants) and also thanks for the reference to the documentation(we were using the same permissions anyways, but a refresher was good). Auto-closed by PR #648. Please get the latest from master

$ go get -v -u github.com/odeke-em/drive/drive-gen && drive-gen

and then you can now do this

$ drive share --type user,anyone,anyone,user --role reader,anyone --emails "emm.odeke@gmail.com" outf.gif
Provide access for accountType(s)
  user
  anyone

For roles(s)
  reader

Addressees:
  + emm.odeke@gmail.com
  + Anyone with the link

File(s) to share:
  + outf.gif

Proceed with the changes? [Y/n]:y
successful share for outf.gif with email "emm.odeke@gmail.com", role "reader" accountType "user"
successful share for outf.gif with email "", role "reader" accountType "anyone"

Then get the URL of the file

$ drive url outf.gif

Please reopen if it persists.

@thebaddie
Copy link

Testing it right now but it still is public and indexed,
maybe is the allowFileDiscovery: false missing?

Sharing screenshot

odeke-em added a commit that referenced this issue Jun 30, 2016
Enables sharing to anyone with the link but the file won't be
publicly indexed as is usually with files that are published publicly.

```shell
$ drive share --with-link ComedyPunchlineDrumSound.mp3
```

Fixes #568.
Follows suggestions in
#650 (comment).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants