Skip to content

Commit

Permalink
fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
VPolka committed Dec 20, 2023
1 parent bcddff7 commit 9403e3b
Show file tree
Hide file tree
Showing 13 changed files with 175 additions and 185 deletions.
16 changes: 8 additions & 8 deletions ydb/core/kqp/gateway/kqp_ic_gateway.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,8 +688,8 @@ namespace {
};

struct TModifyPermissionsWrapper : public TThrRefBase {
using TMethod = std::function<void(NYql::TModifyPermissionsSettings::EAction action, THashSet<TString>&& permissions, THashSet<TString>&& roles, TVector<TString>&& pathes)>;
TMethod ModifyPermissionsForPathes;
using TMethod = std::function<void(NYql::TModifyPermissionsSettings::EAction action, THashSet<TString>&& permissions, THashSet<TString>&& roles, TVector<TString>&& paths)>;
TMethod ModifyPermissionsForPaths;
};
}

Expand Down Expand Up @@ -1275,18 +1275,18 @@ class TKikimrIcGateway : public IKqpGateway {
return MakeFuture(ResultFromError<TGenericResult>("No permissions names for modify permissions"));
}

if (settings.Pathes.empty()) {
return MakeFuture(ResultFromError<TGenericResult>("No pathes for modify permissions"));
if (settings.Paths.empty()) {
return MakeFuture(ResultFromError<TGenericResult>("No paths for modify permissions"));
}

if (settings.Roles.empty()) {
return MakeFuture(ResultFromError<TGenericResult>("No roles for modify permissions"));
}

TVector<TPromise<TGenericResult>> promises;
promises.reserve(settings.Pathes.size());
promises.reserve(settings.Paths.size());
TVector<TFuture<TGenericResult>> futures;
futures.reserve(settings.Pathes.size());
futures.reserve(settings.Paths.size());

NACLib::TDiffACL acl;
switch (settings.Action) {
Expand Down Expand Up @@ -1322,8 +1322,8 @@ class TKikimrIcGateway : public IKqpGateway {
const auto serializedDiffAcl = acl.SerializeAsString();

TVector<std::pair<const TString*, std::pair<TString, TString>>> pathPairs;
pathPairs.reserve(settings.Pathes.size());
for (const auto& path : settings.Pathes) {
pathPairs.reserve(settings.Paths.size());
for (const auto& path : settings.Paths) {
pathPairs.push_back(std::make_pair(&path, NSchemeHelpers::SplitPathByDirAndBaseNames(path)));
}

Expand Down
2 changes: 1 addition & 1 deletion ydb/core/kqp/gateway/utils/scheme_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void FillCreateExternalTableColumnDesc(NKikimrSchemeOp::TExternalTableDescriptio
std::pair<TString, TString> SplitPathByDirAndBaseNames(const TString& path) {
auto splitPos = path.find_last_of('/');
if (splitPos == path.npos || splitPos + 1 == path.size()) {
ythrow yexception() << "wrong path format '" << path << "'" ;
ythrow yexception() << "wrong path format '" << path << "'";
}
return {path.substr(0, splitPos), path.substr(splitPos + 1)};
}
Expand Down
Loading

0 comments on commit 9403e3b

Please sign in to comment.