Requires an admin user to access this resource.

def require_admin(func):
    """
    Requires an admin user to access this resource.
    """

    @wraps(func)
    @require_login
    def decorated(*args, **kwargs):
        user = current_user()
        if user and user.is_admin:
            return func(*args, **kwargs)
        else:
            return Response(
                'Forbidden', 403
            )

    return decorated