Revision 6c9df07c

b/docs/pithos-api-guide.rst
1085 1085
==============================  ==============================
1086 1086
202 (Accepted)                  The request has been accepted (not a data update)
1087 1087
204 (No Content)                The request succeeded (data updated)
1088
400 (Bad Request)               Invalid ``X-Object-Sharing`` or ``X-Object-Bytes`` header or missing ``Content-Range`` header or invalid source object or source object length is smaller than range length or ``Content-Length`` does not match range length
1088 1089
411 (Length Required)           Missing ``Content-Length`` in the request
1089 1090
413 (Request Entity Too Large)  Insufficient quota to complete the request
1090 1091
416 (Range Not Satisfiable)     The supplied range is invalid
b/snf-pithos-app/pithos/api/test/objects.py
1882 1882
        content = r.content
1883 1883
        self.assertEqual(content, d2 + d3[-1])
1884 1884

  
1885
    def test_update_invalid_permissions(self):
1886
        url = join_urls(self.pithos_path, self.user, self.container,
1887
                        self.object)
1888
        r = self.post(url, content_type='', HTTP_CONTENT_RANGE='bytes */*',
1889
                      HTTP_X_OBJECT_SHARING='%s' % (257*'a'))
1890
        self.assertEqual(r.status_code, 400)
1891

  
1892
        r = self.post(url, content_type='', HTTP_CONTENT_RANGE='bytes */*',
1893
                      HTTP_X_OBJECT_SHARING='read=%s' % (257*'a'))
1894
        self.assertEqual(r.status_code, 400)
1895

  
1896
        r = self.post(url, content_type='', HTTP_CONTENT_RANGE='bytes */*',
1897
                      HTTP_X_OBJECT_SHARING='write=%s' % (257*'a'))
1898
        self.assertEqual(r.status_code, 400)
1885 1899

  
1886 1900
class ObjectDelete(PithosAPITest):
1887 1901
    def setUp(self):
b/snf-pithos-backend/pithos/backends/modular.py
933 933
        path = self._lookup_object(account, container, name,
934 934
                                   lock_container=True)[0]
935 935
        self._check_permissions(path, permissions)
936
        self.permissions.access_set(path, permissions)
937
        self._report_sharing_change(user, account, path, {'members':
938
                                    self.permissions.access_members(path)})
936
        try:
937
            self.permissions.access_set(path, permissions)
938
        except:
939
            raise ValueError
940
        else:
941
            self._report_sharing_change(user, account, path, {'members':
942
                                        self.permissions.access_members(path)})
939 943

  
940 944
    @debug_method
941 945
    def get_object_public(self, user, account, container, name):

Also available in: Unified diff