mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
36 lines
1.0 KiB
C++
36 lines
1.0 KiB
C++
#include <Access/EnabledRolesInfo.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
Strings EnabledRolesInfo::getCurrentRolesNames() const
|
|
{
|
|
Strings result;
|
|
result.reserve(current_roles.size());
|
|
for (const auto & id : current_roles)
|
|
result.emplace_back(names_of_roles.at(id));
|
|
return result;
|
|
}
|
|
|
|
|
|
Strings EnabledRolesInfo::getEnabledRolesNames() const
|
|
{
|
|
Strings result;
|
|
result.reserve(enabled_roles.size());
|
|
for (const auto & id : enabled_roles)
|
|
result.emplace_back(names_of_roles.at(id));
|
|
return result;
|
|
}
|
|
|
|
|
|
bool operator==(const EnabledRolesInfo & lhs, const EnabledRolesInfo & rhs)
|
|
{
|
|
return (lhs.current_roles == rhs.current_roles) && (lhs.enabled_roles == rhs.enabled_roles)
|
|
&& (lhs.enabled_roles_with_admin_option == rhs.enabled_roles_with_admin_option) && (lhs.names_of_roles == rhs.names_of_roles)
|
|
&& (lhs.access == rhs.access) && (lhs.access_with_grant_option == rhs.access_with_grant_option)
|
|
&& (lhs.settings_from_enabled_roles == rhs.settings_from_enabled_roles);
|
|
}
|
|
|
|
}
|