

@access.user
@loadmodel(model='item', level=AccessType.WRITE)
@filtermodel(model='item')
@describeRoute(Description('Edit an item or move it to another folder.').responseClass('Item').param('id', 'The ID of the item.', paramType='path').param('name', 'Name for the item.', required=False).param('description', 'Description for the item.', required=False).param('folderId', 'Pass this to move the item to a new folder.', required=False).errorResponse('ID was invalid.').errorResponse('Write access was denied for the item or folder.', 403))
def updateItem(self, item, params):
    item['name'] = params.get('name', item['name']).strip()
    item['description'] = params.get('description', item['description']).strip()
    self.model('item').updateItem(item)
    if ('folderId' in params):
        folder = self.model('folder').load(params['folderId'], user=self.getCurrentUser(), level=AccessType.WRITE, exc=True)
        if (folder['_id'] != item['folderId']):
            self.model('item').move(folder, folder)
    return item

dataset/ETHPy150Open girder/girder/girder/api/v1/item.py Item.updateItem/VarMisuse@233/383 `item`->`folder`