{"action":"closed","number":3724,"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3724","id":40476113,"html_url":"https://github.com/CenterForOpenScience/osf.io/pull/3724","diff_url":"https://github.com/CenterForOpenScience/osf.io/pull/3724.diff","patch_url":"https://github.com/CenterForOpenScience/osf.io/pull/3724.patch","issue_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3724","number":3724,"state":"closed","locked":false,"title":"[Ready for Review] Checkout File","user":{"login":"hmoco","id":6268982,"avatar_url":"https://avatars.githubusercontent.com/u/6268982?v=3","gravatar_id":"","url":"https://api.github.com/users/hmoco","html_url":"https://github.com/hmoco","followers_url":"https://api.github.com/users/hmoco/followers","following_url":"https://api.github.com/users/hmoco/following{/other_user}","gists_url":"https://api.github.com/users/hmoco/gists{/gist_id}","starred_url":"https://api.github.com/users/hmoco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmoco/subscriptions","organizations_url":"https://api.github.com/users/hmoco/orgs","repos_url":"https://api.github.com/users/hmoco/repos","events_url":"https://api.github.com/users/hmoco/events{/privacy}","received_events_url":"https://api.github.com/users/hmoco/received_events","type":"User","site_admin":false},"body":"#### Needs to be merged with https://github.com/CenterForOpenScience/waterbutler/pull/67\r\n\r\n### Purpose\r\nThis will add the functionality of locking a single file/component/project for OSF Storage files, preventing other 'edit' contributors to change it. It features a force-unlock, where users with admin permissions can force-unlock a file locked by another user.\r\n\r\n### Changes\r\n#### Functionality:\r\n- Edits, upload new version: Both are blocked for any user that is not the user that has locked the file.\r\n- Move, delete: Deletion cannot happen while a file is locked, regardless of user. \r\nIf any of the above is attempted with the wrong user, a 404 response is sent back.\r\n- FileNode has new methods and fields to support locking, lock check.\r\n\r\n#### UI:\r\n##### Locking entire component/project, or single file on fangorn:\r\n![screen shot 2015-08-04 at 9 27 15 am](https://cloud.githubusercontent.com/assets/6268982/9061695/6e8d6402-3a8b-11e5-9c0f-b717e4b3a729.png)\r\n\r\n![screen shot 2015-08-04 at 9 23 08 am](https://cloud.githubusercontent.com/assets/6268982/9061677/55387b54-3a8b-11e5-8852-e9754bcb9400.png)\r\n\r\n\r\n##### Locking a file:\r\n![screen shot 2015-08-04 at 9 23 21 am](https://cloud.githubusercontent.com/assets/6268982/9061660/3b7719d2-3a8b-11e5-8236-fa6513f4cf80.png)\r\n![screen shot 2015-08-04 at 9 23 32 am](https://cloud.githubusercontent.com/assets/6268982/9061662/3dc403c6-3a8b-11e5-98ce-ab27c5065701.png)\r\n\r\n\r\n##### Unlocking a file:\r\n![screen shot 2015-08-04 at 9 23 43 am](https://cloud.githubusercontent.com/assets/6268982/9061656/379e332c-3a8b-11e5-81fe-d9e535a73ab0.png)\r\n\r\n\r\n##### Force unlock:\r\n![screen shot 2015-08-04 at 9 25 10 am](https://cloud.githubusercontent.com/assets/6268982/9061636/15d8e8ae-3a8b-11e5-95b7-512fb330d3e0.png)\r\n![screen shot 2015-08-04 at 9 25 20 am](https://cloud.githubusercontent.com/assets/6268982/9061652/2f4eb052-3a8b-11e5-9708-d0c849952888.png)\r\n\r\n\r\n### Side Effects\r\nExtra request on file page load for osfstorage files.\r\nMore information on waterbutler callback\r\nButton creep on file page and fangorn view\r\nChanges ``` test_email_sent_when_reg_user_is_added ``` so that it allows for a one second differential.\r\n\r\n### Goals:\r\n- [x] Edit, delete buttons are not shown when locked\r\n- [x] Cannot upload new version (or edit) if not renter, or if no renter\r\n- [x] Cannot deleted if rented (at all)\r\n- [x] Warning message saying its rented\r\n- [x] Add rent information to metadata\r\n\r\n~~- [x] Timing system (rent for a deliberate amount of time)~~\r\n- [x] Make sure files cannot be rented if not logged in (auth check)\r\n\r\n### New Goals:\r\n- [x] Allow admins to steal back a file\r\n- [x] Allow lock of entire component(backend)\r\n- [x] Button for component lock\r\n- [x] Write and fix tests\r\n- [x] Fix UI minor problems","created_at":"2015-07-21T16:20:28Z","updated_at":"2015-11-02T14:15:42Z","closed_at":"2015-11-02T14:15:42Z","merged_at":"2015-11-02T14:15:42Z","merge_commit_sha":"2386af7949fb9b24256cdba3a56c12909e12e074","assignee":null,"milestone":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/milestones/54","html_url":"https://github.com/CenterForOpenScience/osf.io/milestones/0.55.0","labels_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/milestones/54/labels","id":1369058,"number":54,"title":"0.55.0","description":"Sprint (5)","creator":{"login":"sloria","id":2379650,"avatar_url":"https://avatars.githubusercontent.com/u/2379650?v=3","gravatar_id":"","url":"https://api.github.com/users/sloria","html_url":"https://github.com/sloria","followers_url":"https://api.github.com/users/sloria/followers","following_url":"https://api.github.com/users/sloria/following{/other_user}","gists_url":"https://api.github.com/users/sloria/gists{/gist_id}","starred_url":"https://api.github.com/users/sloria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sloria/subscriptions","organizations_url":"https://api.github.com/users/sloria/orgs","repos_url":"https://api.github.com/users/sloria/repos","events_url":"https://api.github.com/users/sloria/events{/privacy}","received_events_url":"https://api.github.com/users/sloria/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":23,"state":"open","created_at":"2015-10-21T20:47:56Z","updated_at":"2015-11-02T14:15:42Z","due_on":"2015-11-04T05:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3724/commits","review_comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3724/comments","review_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3724/comments","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/035a56c59ed5ede441e0a260e466cb84ff79151c","head":{"label":"hmoco:feature/rent_file","ref":"feature/rent_file","sha":"035a56c59ed5ede441e0a260e466cb84ff79151c","user":{"login":"hmoco","id":6268982,"avatar_url":"https://avatars.githubusercontent.com/u/6268982?v=3","gravatar_id":"","url":"https://api.github.com/users/hmoco","html_url":"https://github.com/hmoco","followers_url":"https://api.github.com/users/hmoco/followers","following_url":"https://api.github.com/users/hmoco/following{/other_user}","gists_url":"https://api.github.com/users/hmoco/gists{/gist_id}","starred_url":"https://api.github.com/users/hmoco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmoco/subscriptions","organizations_url":"https://api.github.com/users/hmoco/orgs","repos_url":"https://api.github.com/users/hmoco/repos","events_url":"https://api.github.com/users/hmoco/events{/privacy}","received_events_url":"https://api.github.com/users/hmoco/received_events","type":"User","site_admin":false},"repo":{"id":36302791,"name":"osf.io","full_name":"hmoco/osf.io","owner":{"login":"hmoco","id":6268982,"avatar_url":"https://avatars.githubusercontent.com/u/6268982?v=3","gravatar_id":"","url":"https://api.github.com/users/hmoco","html_url":"https://github.com/hmoco","followers_url":"https://api.github.com/users/hmoco/followers","following_url":"https://api.github.com/users/hmoco/following{/other_user}","gists_url":"https://api.github.com/users/hmoco/gists{/gist_id}","starred_url":"https://api.github.com/users/hmoco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmoco/subscriptions","organizations_url":"https://api.github.com/users/hmoco/orgs","repos_url":"https://api.github.com/users/hmoco/repos","events_url":"https://api.github.com/users/hmoco/events{/privacy}","received_events_url":"https://api.github.com/users/hmoco/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hmoco/osf.io","description":"Facilitating Open Science","fork":true,"url":"https://api.github.com/repos/hmoco/osf.io","forks_url":"https://api.github.com/repos/hmoco/osf.io/forks","keys_url":"https://api.github.com/repos/hmoco/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmoco/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmoco/osf.io/teams","hooks_url":"https://api.github.com/repos/hmoco/osf.io/hooks","issue_events_url":"https://api.github.com/repos/hmoco/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/hmoco/osf.io/events","assignees_url":"https://api.github.com/repos/hmoco/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/hmoco/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/hmoco/osf.io/tags","blobs_url":"https://api.github.com/repos/hmoco/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmoco/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmoco/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmoco/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmoco/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/hmoco/osf.io/languages","stargazers_url":"https://api.github.com/repos/hmoco/osf.io/stargazers","contributors_url":"https://api.github.com/repos/hmoco/osf.io/contributors","subscribers_url":"https://api.github.com/repos/hmoco/osf.io/subscribers","subscription_url":"https://api.github.com/repos/hmoco/osf.io/subscription","commits_url":"https://api.github.com/repos/hmoco/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmoco/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmoco/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmoco/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmoco/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/hmoco/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmoco/osf.io/merges","archive_url":"https://api.github.com/repos/hmoco/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmoco/osf.io/downloads","issues_url":"https://api.github.com/repos/hmoco/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/hmoco/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/hmoco/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/hmoco/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmoco/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/hmoco/osf.io/releases{/id}","created_at":"2015-05-26T14:49:58Z","updated_at":"2015-10-02T18:35:52Z","pushed_at":"2015-10-30T20:23:28Z","git_url":"git://github.com/hmoco/osf.io.git","ssh_url":"git@github.com:hmoco/osf.io.git","clone_url":"https://github.com/hmoco/osf.io.git","svn_url":"https://github.com/hmoco/osf.io","homepage":"http://osf.io","size":105857,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"develop"}},"base":{"label":"CenterForOpenScience:develop","ref":"develop","sha":"e122cd09851e659c946a68053b345ac177c192e5","user":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"repo":{"id":10199599,"name":"osf.io","full_name":"CenterForOpenScience/osf.io","owner":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CenterForOpenScience/osf.io","description":"Facilitating Open Science","fork":false,"url":"https://api.github.com/repos/CenterForOpenScience/osf.io","forks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/forks","keys_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/teams","hooks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/hooks","issue_events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/events","assignees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/tags","blobs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/languages","stargazers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/stargazers","contributors_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contributors","subscribers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscribers","subscription_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscription","commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/merges","archive_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/downloads","issues_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/releases{/id}","created_at":"2013-05-21T15:53:37Z","updated_at":"2015-11-01T21:33:13Z","pushed_at":"2015-11-02T14:15:38Z","git_url":"git://github.com/CenterForOpenScience/osf.io.git","ssh_url":"git@github.com:CenterForOpenScience/osf.io.git","clone_url":"https://github.com/CenterForOpenScience/osf.io.git","svn_url":"https://github.com/CenterForOpenScience/osf.io","homepage":"http://osf.io","size":241795,"stargazers_count":153,"watchers_count":153,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":129,"mirror_url":null,"open_issues_count":355,"forks":129,"open_issues":355,"watchers":153,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3724"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/3724"},"issue":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3724"},"comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3724/comments"},"review_comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3724/comments"},"review_comment":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3724/commits"},"statuses":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/035a56c59ed5ede441e0a260e466cb84ff79151c"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"sloria","id":2379650,"avatar_url":"https://avatars.githubusercontent.com/u/2379650?v=3","gravatar_id":"","url":"https://api.github.com/users/sloria","html_url":"https://github.com/sloria","followers_url":"https://api.github.com/users/sloria/followers","following_url":"https://api.github.com/users/sloria/following{/other_user}","gists_url":"https://api.github.com/users/sloria/gists{/gist_id}","starred_url":"https://api.github.com/users/sloria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sloria/subscriptions","organizations_url":"https://api.github.com/users/sloria/orgs","repos_url":"https://api.github.com/users/sloria/repos","events_url":"https://api.github.com/users/sloria/events{/privacy}","received_events_url":"https://api.github.com/users/sloria/received_events","type":"User","site_admin":false},"comments":61,"review_comments":61,"commits":134,"additions":518,"deletions":29,"changed_files":17}}