'GET /api/groups
Displays a collection (list) of groups.'

@web.expose_api
@web.require_admin
def index(self, trans, **kwd):

    rval = []
    for group in trans.sa_session.query(trans.app.model.Group).filter((trans.app.model.Group.table.c.deleted == false())):
        if trans.user_is_admin():
            item = group.to_dict(value_mapper={'id': trans.security.encode_id})
            encoded_id = trans.security.encode_id(group.id)
            item['url'] = url_for('group', id=encoded_id)
            rval.append(item)
    return rval
