'index( self, trans, deleted=False, **kwd )
* GET /api/pages
return a list of Pages viewable by the user
:param deleted: Display deleted pages
:rtype:     list
:returns:   dictionaries containing summary or detailed Page information'

@expose_api
def index(self, trans, deleted=False, **kwd):

    out = []
    if trans.user_is_admin():
        r = trans.sa_session.query(trans.app.model.Page)
        if (not deleted):
            r = r.filter_by(deleted=False)
        for row in r:
            out.append(self.encode_all_ids(trans, row.to_dict(), True))
    else:
        user = trans.get_user()
        r = trans.sa_session.query(trans.app.model.Page).filter_by(user=user)
        if (not deleted):
            r = r.filter_by(deleted=False)
        for row in r:
            out.append(self.encode_all_ids(trans, row.to_dict(), True))
        r = trans.sa_session.query(trans.app.model.Page).filter((trans.app.model.Page.user != user)).filter_by(published=True)
        if (not deleted):
            r = r.filter_by(deleted=False)
        for row in r:
            out.append(self.encode_all_ids(trans, row.to_dict(), True))
    return out
