Revision 3436eeb0 pithos/backends/base.py

b/pithos/backends/base.py
182 182
        """
183 183
        return
184 184
    
185
    def get_object_permissions(self, user, account, container, name):
186
        """Return a dictionary with the object permissions.
187
        
188
        The keys are:
189
            'public': The object is readable by all and available at a public URL
190
            'private': No permissions set
191
            'read': The object is readable by the users/groups in the list
192
            'write': The object is writable by the users/groups in the list
193
        
194
        Raises:
195
            NameError: Container/object does not exist
196
        """
197
        return {}
198
    
199
    def update_object_permissions(self, user, account, container, name, permissions):
200
        """Update the permissions associated with the object.
201
        
202
        Parameters:
203
            'permissions': Dictionary with permissions to update
204
        
205
        Raises:
206
            NameError: Container/object does not exist
207
            ValueError: Invalid users/groups in permissions
208
            AttributeError: Can not set permissions, as this object\
209
                is already shared/private by another object higher\
210
                in the hierarchy, or setting permissions here will\
211
                invalidate other permissions deeper in the hierarchy
212
        """
213
        return
214
    
185 215
    def get_object_hashmap(self, user, account, container, name, version=None):
186 216
        """Return the object's size and a list with partial hashes.
187 217
        
......
191 221
        """
192 222
        return 0, []
193 223
    
194
    def update_object_hashmap(self, user, account, container, name, size, hashmap, meta={}, replace_meta=False):
224
    def update_object_hashmap(self, user, account, container, name, size, hashmap, meta={}, replace_meta=False, permissions={}):
195 225
        """Create/update an object with the specified size and partial hashes.
196 226
        
227
        Parameters:
228
            'dest_meta': Dictionary with metadata to change
229
            'replace_meta': Replace metadata instead of update
230
            'permissions': Updated object permissions
231
        
197 232
        Raises:
198 233
            NameError: Container does not exist
234
            ValueError: Invalid users/groups in permissions
235
            AttributeError: Can not set permissions
199 236
        """
200 237
        return
201 238
    
202
    def copy_object(self, user, account, src_container, src_name, dest_container, dest_name, dest_meta={}, replace_meta=False, src_version=None):
239
    def copy_object(self, user, account, src_container, src_name, dest_container, dest_name, dest_meta={}, replace_meta=False, permissions={}, src_version=None):
203 240
        """Copy an object's data and metadata.
204 241
        
205 242
        Parameters:
206
            'dest_meta': Dictionary with metadata to changes from source to destination
243
            'dest_meta': Dictionary with metadata to change from source to destination
207 244
            'replace_meta': Replace metadata instead of update
208
            'src_version': Copy from the version provided.
245
            'permissions': New object permissions
246
            'src_version': Copy from the version provided
209 247
        
210 248
        Raises:
211 249
            NameError: Container/object does not exist
212 250
            IndexError: Version does not exist
251
            ValueError: Invalid users/groups in permissions
252
            AttributeError: Can not set permissions
213 253
        """
214 254
        return
215 255
    
216
    def move_object(self, user, account, src_container, src_name, dest_container, dest_name, dest_meta={}, replace_meta=False):
256
    def move_object(self, user, account, src_container, src_name, dest_container, dest_name, dest_meta={}, replace_meta=False, permissions={}):
217 257
        """Move an object's data and metadata.
218 258
        
219 259
        Parameters:
220
            'dest_meta': Dictionary with metadata to changes from source to destination
260
            'dest_meta': Dictionary with metadata to change from source to destination
221 261
            'replace_meta': Replace metadata instead of update
262
            'permissions': New object permissions
222 263
        
223 264
        Raises:
224 265
            NameError: Container/object does not exist
266
            ValueError: Invalid users/groups in permissions
267
            AttributeError: Can not set permissions
225 268
        """
226 269
        return
227 270
    

Also available in: Unified diff