diff --git a/CMakeLists.txt b/CMakeLists.txt index de6be81..53c6130 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,4 +72,5 @@ target_link_libraries(${BIN_NAME} PRIVATE ) install(TARGETS ${BIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}) +install(FILES polkit-1/rules.d/org.deepin.dde.application-wizard.rules DESTINATION ${CMAKE_INSTALL_DATADIR}/polkit-1/rules.d) install(FILES ${TRANSLATED_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/dde-application-wizard/translations) diff --git a/polkit-1/rules.d/org.deepin.dde.application-wizard.rules b/polkit-1/rules.d/org.deepin.dde.application-wizard.rules new file mode 100644 index 0000000..3f4490a --- /dev/null +++ b/polkit-1/rules.d/org.deepin.dde.application-wizard.rules @@ -0,0 +1,11 @@ +// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +polkit.addRule(function(action, subject) { + if ((action.id == "org.freedesktop.packagekit.package-remove") && + subject.active == true && subject.local == true && + subject.isInGroup("sudo")) { + return polkit.Result.YES; + } +});