2019-11-09 15:33:07 +00:00
|
|
|
#include <Access/IAccessEntity.h>
|
2019-11-04 19:17:27 +00:00
|
|
|
#include <Access/Quota.h>
|
2019-11-17 11:57:02 +00:00
|
|
|
#include <Access/RowPolicy.h>
|
2020-01-26 09:49:53 +00:00
|
|
|
#include <Access/User.h>
|
2019-11-09 15:33:07 +00:00
|
|
|
#include <common/demangle.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
String IAccessEntity::getTypeName(std::type_index type)
|
|
|
|
{
|
2020-01-26 09:49:53 +00:00
|
|
|
if (type == typeid(User))
|
|
|
|
return "User";
|
2019-11-04 19:17:27 +00:00
|
|
|
if (type == typeid(Quota))
|
|
|
|
return "Quota";
|
2019-11-17 11:57:02 +00:00
|
|
|
if (type == typeid(RowPolicy))
|
|
|
|
return "Row policy";
|
2019-11-09 15:33:07 +00:00
|
|
|
return demangle(type.name());
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IAccessEntity::equal(const IAccessEntity & other) const
|
|
|
|
{
|
|
|
|
return (full_name == other.full_name) && (getType() == other.getType());
|
|
|
|
}
|
|
|
|
}
|