{"action":"created","issue":{"url":"https://api.github.com/repos/sehmaschine/django-filebrowser/issues/285","labels_url":"https://api.github.com/repos/sehmaschine/django-filebrowser/issues/285/labels{/name}","comments_url":"https://api.github.com/repos/sehmaschine/django-filebrowser/issues/285/comments","events_url":"https://api.github.com/repos/sehmaschine/django-filebrowser/issues/285/events","html_url":"https://github.com/sehmaschine/django-filebrowser/pull/285","id":107384955,"number":285,"title":"Avoid strict dependency on os when setting file permission during upload","user":{"login":"tomassommar","id":2788731,"avatar_url":"https://avatars.githubusercontent.com/u/2788731?v=3","gravatar_id":"","url":"https://api.github.com/users/tomassommar","html_url":"https://github.com/tomassommar","followers_url":"https://api.github.com/users/tomassommar/followers","following_url":"https://api.github.com/users/tomassommar/following{/other_user}","gists_url":"https://api.github.com/users/tomassommar/gists{/gist_id}","starred_url":"https://api.github.com/users/tomassommar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomassommar/subscriptions","organizations_url":"https://api.github.com/users/tomassommar/orgs","repos_url":"https://api.github.com/users/tomassommar/repos","events_url":"https://api.github.com/users/tomassommar/events{/privacy}","received_events_url":"https://api.github.com/users/tomassommar/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-09-20T10:09:05Z","updated_at":"2015-10-02T15:11:15Z","closed_at":"2015-09-21T14:37:58Z","pull_request":{"url":"https://api.github.com/repos/sehmaschine/django-filebrowser/pulls/285","html_url":"https://github.com/sehmaschine/django-filebrowser/pull/285","diff_url":"https://github.com/sehmaschine/django-filebrowser/pull/285.diff","patch_url":"https://github.com/sehmaschine/django-filebrowser/pull/285.patch"},"body":"<strong>Tests: OK\r\nVersion: FileBrowser 3.6.1, Grappelli 2.7.1, Django 1.8.4</strong>\r\n\r\nIn the function _upload_file in the sites module, there is a strict dependency on os.chmod. os.chmod will be called independently of the underlying storage provider. Thus, if using S3BotoStorage as storage backend, os.chmod will be executed even though the file is not to be stored locally. \r\n\r\nFurthermore, FileObject.path_full will be called, which in turn will call path on the underlying storage provider. As specified in the [File Storage Django documentation](https://docs.djangoproject.com/en/1.8/ref/files/storage/ \"File Storage Django\"), this is only to be implemented for local filesystems. Hence, this will cause Filebrowser to throw an NotImplementedError when using S3BotoStorage as Storage provider.\r\n\r\nThis can easily be resolved by abstracting the setting of file permissions to the StorageMixin. The correct way to set file permissions for the underlying storage will then be called, rather than calling os.chmod independently of the underlying storage provider.\r\n\r\nThe following pull requests suggests such an implementation. "},"comment":{"url":"https://api.github.com/repos/sehmaschine/django-filebrowser/issues/comments/145056150","html_url":"https://github.com/sehmaschine/django-filebrowser/pull/285#issuecomment-145056150","issue_url":"https://api.github.com/repos/sehmaschine/django-filebrowser/issues/285","id":145056150,"user":{"login":"tomassommar","id":2788731,"avatar_url":"https://avatars.githubusercontent.com/u/2788731?v=3","gravatar_id":"","url":"https://api.github.com/users/tomassommar","html_url":"https://github.com/tomassommar","followers_url":"https://api.github.com/users/tomassommar/followers","following_url":"https://api.github.com/users/tomassommar/following{/other_user}","gists_url":"https://api.github.com/users/tomassommar/gists{/gist_id}","starred_url":"https://api.github.com/users/tomassommar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomassommar/subscriptions","organizations_url":"https://api.github.com/users/tomassommar/orgs","repos_url":"https://api.github.com/users/tomassommar/repos","events_url":"https://api.github.com/users/tomassommar/events{/privacy}","received_events_url":"https://api.github.com/users/tomassommar/received_events","type":"User","site_admin":false},"created_at":"2015-10-02T15:11:15Z","updated_at":"2015-10-02T15:11:15Z","body":"Yes, it was intended as a step towards working with other storage engines than the filesystem. But it obviously needs some revision before it's releasable. \r\n\r\n"}}