{"action":"closed","issue":{"url":"https://api.github.com/repos/teamed/nerodesk/issues/103","labels_url":"https://api.github.com/repos/teamed/nerodesk/issues/103/labels{/name}","comments_url":"https://api.github.com/repos/teamed/nerodesk/issues/103/comments","events_url":"https://api.github.com/repos/teamed/nerodesk/issues/103/events","html_url":"https://github.com/teamed/nerodesk/issues/103","id":63128826,"number":103,"title":"file sharing doesn't work","user":{"login":"yegor256","id":526301,"avatar_url":"https://avatars.githubusercontent.com/u/526301?v=3","gravatar_id":"","url":"https://api.github.com/users/yegor256","html_url":"https://github.com/yegor256","followers_url":"https://api.github.com/users/yegor256/followers","following_url":"https://api.github.com/users/yegor256/following{/other_user}","gists_url":"https://api.github.com/users/yegor256/gists{/gist_id}","starred_url":"https://api.github.com/users/yegor256/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yegor256/subscriptions","organizations_url":"https://api.github.com/users/yegor256/orgs","repos_url":"https://api.github.com/users/yegor256/repos","events_url":"https://api.github.com/users/yegor256/events{/privacy}","received_events_url":"https://api.github.com/users/yegor256/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/teamed/nerodesk/labels/30%20mins","name":"30 mins","color":"eb6421"},{"url":"https://api.github.com/repos/teamed/nerodesk/labels/bug","name":"bug","color":"c0c0c0"},{"url":"https://api.github.com/repos/teamed/nerodesk/labels/DEV","name":"DEV","color":"bfd4f3"}],"state":"closed","locked":false,"assignee":{"login":"yegor256","id":526301,"avatar_url":"https://avatars.githubusercontent.com/u/526301?v=3","gravatar_id":"","url":"https://api.github.com/users/yegor256","html_url":"https://github.com/yegor256","followers_url":"https://api.github.com/users/yegor256/followers","following_url":"https://api.github.com/users/yegor256/following{/other_user}","gists_url":"https://api.github.com/users/yegor256/gists{/gist_id}","starred_url":"https://api.github.com/users/yegor256/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yegor256/subscriptions","organizations_url":"https://api.github.com/users/yegor256/orgs","repos_url":"https://api.github.com/users/yegor256/repos","events_url":"https://api.github.com/users/yegor256/events{/privacy}","received_events_url":"https://api.github.com/users/yegor256/received_events","type":"User","site_admin":false},"milestone":null,"comments":14,"created_at":"2015-03-20T00:54:58Z","updated_at":"2015-03-27T03:58:48Z","closed_at":"2015-03-27T03:58:48Z","body":"Our README promises that a user is able to share his/her files with other users. At the moment, this doesn't work. Let's implement this feature. Let's extend our interfaces with this:\r\n\r\n```java\r\ninterface Doc {\r\n  // shares this document with another user\r\n  // if this document is not mine - throws a runtime exception\r\n  void shareWith(String urn);\r\n  // show a list of people who I share this document with\r\n  Iterable<String> friends();\r\n  // stop sharing this document with this user, and prohibit access\r\n  void prohibit(String urn);\r\n  // return a list of friends who share something with me\r\n  Iterable<String> sharers();\r\n  // get documents shared with me by this user\r\n  Iterable<Doc> access(String urn);\r\n}\r\n```\r\n\r\nI think we should use DynamoDB for keeping that links between projects. I would suggest to use a table with this structure:\r\n\r\n```\r\n{owner, friend, document}\r\n```\r\n\r\nHere, `friend` is a hash, `owner` is a range, and `document`. With this structure, when \"Jeff\" shares a document \"pic.jpg\" and calls `shareWith(\"Sarah\")`, we put this item to the DB:\r\n\r\n```\r\n{friend:Sarah, owner:Jeff, document:pic.jpg}\r\n```\r\n"}}