File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
include/ydb-cpp-sdk/client/scheme Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ namespace Ydb {
6
6
class VirtualTimestamp ;
7
7
namespace Scheme {
8
8
class Entry ;
9
+ class ModifyPermissionsRequest ;
10
+ class Permissions ;
9
11
}
10
12
}
11
13
@@ -24,6 +26,8 @@ struct TPermissions {
24
26
{}
25
27
std::string Subject;
26
28
std::vector<std::string> PermissionNames;
29
+
30
+ void SerializeTo (::Ydb::Scheme::Permissions& proto) const ;
27
31
};
28
32
29
33
enum class ESchemeEntryType : i32 {
@@ -77,6 +81,9 @@ struct TSchemeEntry {
77
81
TSchemeEntry (const ::Ydb::Scheme::Entry& proto);
78
82
79
83
void Out (IOutputStream& out) const ;
84
+
85
+ // Fills ModifyPermissionsRequest proto from this entry
86
+ void SerializeTo (::Ydb::Scheme::ModifyPermissionsRequest& request) const ;
80
87
};
81
88
82
89
// //////////////////////////////////////////////////////////////////////////////
Original file line number Diff line number Diff line change @@ -17,6 +17,13 @@ namespace NScheme {
17
17
using namespace NThreading ;
18
18
using namespace Ydb ::Scheme;
19
19
20
+ void TPermissions::SerializeTo (::Ydb::Scheme::Permissions& proto) const {
21
+ proto.set_subject (Subject);
22
+ for (const auto & name : PermissionNames) {
23
+ *proto.mutable_permission_names ()->Add () = name;
24
+ }
25
+ }
26
+
20
27
TVirtualTimestamp::TVirtualTimestamp (uint64_t planStep, uint64_t txId)
21
28
: PlanStep(planStep)
22
29
, TxId(txId)
@@ -120,6 +127,13 @@ void TSchemeEntry::Out(IOutputStream& out) const {
120
127
<< " }" ;
121
128
}
122
129
130
+ void TSchemeEntry::SerializeTo (::Ydb::Scheme::ModifyPermissionsRequest& request) const {
131
+ request.mutable_actions ()->Add ()->set_change_owner (Owner);
132
+ for (const auto & permission : Permissions) {
133
+ permission.SerializeTo (*request.mutable_actions ()->Add ()->mutable_set ());
134
+ }
135
+ }
136
+
123
137
class TSchemeClient ::TImpl : public TClientImplCommon<TSchemeClient::TImpl> {
124
138
public:
125
139
TImpl (std::shared_ptr<TGRpcConnectionsImpl>&& connections, const TCommonClientSettings& settings)
You can’t perform that action at this time.
0 commit comments