Skip to content

Commit 824a5fd

Browse files
authored
EXT-1522 Fix CMS manual request approval not emptying request's actions (#25719)
(cherry picked from commit 2f8e513)
1 parent 547e2d2 commit 824a5fd

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

ydb/core/cms/cms.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,6 +1537,10 @@ void TCms::ManuallyApproveRequest(TEvCms::TEvManageRequestRequest::TPtr &ev, con
15371537
perm->SetDeadline(deadline.GetValue());
15381538
}
15391539

1540+
copy->Request.ClearActions();
1541+
1542+
it->second = *copy;
1543+
15401544
AcceptPermissions(resp->Record, rec.GetRequestId(), rec.GetUser(), ctx, true);
15411545

15421546
auto actor = new TRequestApproveActor(requestId, State, ev->Sender);

ydb/core/cms/cms_ut.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,10 @@ Y_UNIT_TEST_SUITE(TCmsTest) {
547547
// Manual approval
548548
auto approveResp = env.CheckApproveRequest("user", rid1, false, TStatus::OK);
549549
UNIT_ASSERT_VALUES_EQUAL(approveResp.ManuallyApprovedPermissionsSize(), 1);
550+
551+
// Check that request is now allowed
552+
env.CheckRequest("user", rid1, false, TStatus::ALLOW);
553+
550554
TString permissionId = approveResp.GetManuallyApprovedPermissions(0).GetId();
551555
auto rec2 = env.CheckGetPermission("user", permissionId);
552556
UNIT_ASSERT_VALUES_EQUAL(rec2.PermissionsSize(), 1);
@@ -636,7 +640,7 @@ Y_UNIT_TEST_SUITE(TCmsTest) {
636640

637641
auto rid1 = rec1.GetRequestId();
638642

639-
// // Manual approval
643+
// Manual approval
640644
auto approveResp = env.CheckApproveRequest("user", rid1, false, TStatus::OK);
641645
UNIT_ASSERT_VALUES_EQUAL(approveResp.ManuallyApprovedPermissionsSize(), 2);
642646
for (const auto& permission : approveResp.GetManuallyApprovedPermissions()) {
@@ -645,6 +649,9 @@ Y_UNIT_TEST_SUITE(TCmsTest) {
645649
UNIT_ASSERT_VALUES_EQUAL(rec3.PermissionsSize(), 1);
646650
UNIT_ASSERT_VALUES_EQUAL(rec3.GetPermissions(0).GetId(), permissionId);
647651
}
652+
653+
// Check that request is now allowed
654+
env.CheckRequest("user", rid1, false, TStatus::ALLOW);
648655
}
649656

650657
Y_UNIT_TEST(ManualRequestApprovalAlreadyLockedNode)

0 commit comments

Comments
 (0)