logoalt Hacker News

black_knighttoday at 10:17 AM1 replyview on HN

You seem to understand it just fine.

Your accessor, dirB, should not contain the “upload files” verb, while your dirA accessor (noun) should.

My favorite example is the home directory and the file picker. Why should a program have access to all your files by default then politely ask you which file it should read/write to? It would make more sense if the file picker was something the operating system ran when a program wants to edit a file, and what came back to the program after you selected was the accessor for that file (with read and/or write verbs).

So the program only have access to those files you have it access to. It cannot even ask the question to open another file, because it only has opaque accessors to those files it has been given.


Replies

nmaddentoday at 10:28 AM

I used to use the example of Dropbox’s chooser API to illustrate this: https://www.dropbox.com/developers/chooser

If you use this API (via a simple widget library) then the user simply picks a file in their dropbox and the app gets access to that one file. Vs OAuth where you grant the app broad access to the whole dropbox (or maybe some sub-folder).

show 1 reply