Skip to content

Commit

Permalink
dnfdaemon: Offline transaction management only for admin
Browse files Browse the repository at this point in the history
  • Loading branch information
m-blaha committed Jun 18, 2024
1 parent 78d7390 commit 880ae2b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dnf5daemon-server/services/offline/offline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ sdbus::MethodReply Offline::check_pending(sdbus::MethodCall & call) {
}

sdbus::MethodReply Offline::clean(sdbus::MethodCall & call) {
if (!session.check_authorization(dnfdaemon::POLKIT_EXECUTE_RPM_TRANSACTION, call.getSender())) {
throw std::runtime_error("Not authorized");
}
std::string error_msg;
dnfdaemon::KeyValueMap options;
call >> options;
Expand All @@ -97,6 +100,9 @@ sdbus::MethodReply Offline::clean(sdbus::MethodCall & call) {
}

sdbus::MethodReply Offline::set_finish_action(sdbus::MethodCall & call) {
if (!session.check_authorization(dnfdaemon::POLKIT_EXECUTE_RPM_TRANSACTION, call.getSender())) {
throw std::runtime_error("Not authorized");
}
bool success{false};
std::string error_msg{};
// try load the offline transaction state
Expand Down

0 comments on commit 880ae2b

Please sign in to comment.