TheFox / flickr-cli

A command-line interface to Flickr. Upload and download photos, photo sets, directories via shell.
https://fox21.at
26 stars 9 forks source link

Why 'delete' permissions? #7

Closed samwilson closed 7 years ago

samwilson commented 7 years ago

This is looking great! :-)

My first impression (with my just-downloaded-and-running-for-the-first-time hat on) is that it asks for 'delete' permissions when I authenticate. As a brand new user, this makes me wary — I think it should explain why it's asking for this. Especially as, if one is just using flickr-cli as a backup system, it should only be required to authenticate with 'read' permissions.

What do you think? I'm not sure what would be best: either to initially authenticate with 'read', and then request to upgrade to 'write' or 'delete' when required — or perhaps just to explain at the beginning why 'delete' is being requested.

Thanks for putting time into this!

TheFox commented 7 years ago

It's because of the Downloader. The Downloader includes a remove command as well, beside the actual download command. I want to migrate these other commands from the Downloader as well. See #4 #5 #6.

I guess upgrading to a newer permission when required is a good approach.

samwilson commented 7 years ago

Ah, that makes sense. But I wonder if asking to elevate privileges when trying to run e.g. the remove command is just extra complication? What about just a small addition to the auth command that asks the user to select read, write, or delete? With a bit of explanation of when each is required—

Please select the permissions you wish to grant:
1) read: download
2) delete: download, with remove option
3) write: upload
Enter selection [3]: _
TheFox commented 7 years ago

The selection on the auth command is a great idea. I also thought about this. I would check the permission on each command too. Doing so storing the permission to config.yml is required. Do you like to implement this?

samwilson commented 7 years ago

Sure, I'd love to have crack at it! :-)

And I was wondering about checking on each command, but only if a request failed, so as not to have extra requests. But maybe that's unnecessary optimisation.

But first things first, I'll implement the new part of the auth command.

samwilson commented 7 years ago

By the way, what coding standard is this project using?

TheFox commented 7 years ago

TheFox' Coding Standard ;) But I'm happy if you use Tabs for indentation. The other styles are optional.

I add .editorconfig in most of my projects. So you can use your favorite editor with EditorConfig plugin.

samwilson commented 7 years ago

8 can take it from here I think.