@auth_decorator
def admin_only(self):
    user = self.get_current_user()
    if user is None or not user.admin:
        raise web.HTTPError(403)


# Token utilities
decorator for restricting access to admin users
dataset/ETHPy150Open jupyterhub/jupyterhub/jupyterhub/utils.py/admin_only