'List user\'s pages.'

@web.expose
@web.json
@web.require_login()
def list(self, trans, *args, **kwargs):

    if (('operation' in kwargs) and ('id' in kwargs)):
        session = trans.sa_session
        operation = kwargs['operation'].lower()
        ids = util.listify(kwargs['id'])
        for id in ids:
            item = session.query(model.Page).get(self.decode_id(id))
            if (operation == 'delete'):
                item.deleted = True
        session.flush()
    kwargs['dict_format'] = True
    grid = self._page_list(trans, *args, **kwargs)
    grid['shared_by_others'] = self._get_shared(trans)
    return grid
