Skip to content

Commit

Permalink
feat: Skip authentication when removing packages by application-wizard
Browse files Browse the repository at this point in the history
Issue: linuxdeepin/developer-center#9432
Log: Skip authentication when removing packages by application-wizard
  • Loading branch information
ArchieMeng authored and deepin-bot[bot] committed Jul 29, 2024
1 parent ae8afbc commit 1e98c77
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
11 changes: 11 additions & 0 deletions polkit-1/rules.d/org.deepin.dde.application-wizard.rules
Original file line number Diff line number Diff line change
@@ -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;
}
});

0 comments on commit 1e98c77

Please sign in to comment.