#pragma once #include #include #include #include namespace DB { struct Role : public IAccessEntity { AccessRights access; GrantedRoles granted_roles; SettingsProfileElements settings; bool equal(const IAccessEntity & other) const override; std::shared_ptr clone() const override { return cloneImpl(); } static constexpr const auto TYPE = AccessEntityType::ROLE; AccessEntityType getType() const override { return TYPE; } std::vector findDependencies() const override; bool hasDependencies(const std::unordered_set & ids) const override; void replaceDependencies(const std::unordered_map & old_to_new_ids) override; void copyDependenciesFrom(const IAccessEntity & src, const std::unordered_set & ids) override; void removeDependencies(const std::unordered_set & ids) override; void clearAllExceptDependencies() override; bool isBackupAllowed() const override { return settings.isBackupAllowed(); } }; using RolePtr = std::shared_ptr; }