Files
scylladb/auth/role_or_anonymous.cc
Avi Kivity 0ae22a09d4 LICENSE: Update to version 1.1
Updated terms of non-commercial use (must be a never-customer).
2026-04-12 19:46:33 +03:00

23 lines
554 B
C++

/*
* Copyright (C) 2018-present ScyllaDB
*/
/*
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.1
*/
#include "auth/role_or_anonymous.hh"
namespace auth {
bool is_anonymous(const role_or_anonymous& mr) noexcept {
return !mr.name.has_value();
}
}
auto fmt::formatter<auth::role_or_anonymous>::format(const auth::role_or_anonymous& mr,
fmt::format_context& ctx) const -> decltype(ctx.out()) {
return fmt::format_to(ctx.out(), "{}", mr.name.value_or("<anonymous>"));
}