Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Build-Depends: debhelper (>= 11),
libnet-dev,
libglib2.0-dev,
libdtk6gui-dev,
libpolkit-qt6-1-dev,
libdtk6core-dev,
libx11-dev,
libxext-dev,
Expand Down Expand Up @@ -44,7 +45,8 @@ Depends:
${misc:Depends},
deepin-service-manager (>> 1.0.21),
dbus,
deepin-power-control (>= 2.0.1)
deepin-power-control (>= 2.0.1),
deepin-security-loader
Recommends:
iio-sensor-proxy
Breaks: dde-daemon (<< 6.1.102)
Expand Down
3 changes: 3 additions & 0 deletions src/plugin-qt/power/system/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core DBus)
find_package(Dtk${DTK_VERSION_MAJOR} REQUIRED COMPONENTS Core)
find_package(PkgConfig REQUIRED)
pkg_check_modules(UDEV REQUIRED libudev)
pkg_check_modules(POLKIT_QT REQUIRED polkit-qt6-1)

file(GLOB_RECURSE SRCS "*.cpp" "*.h")

Expand All @@ -24,13 +25,15 @@ add_library(${BIN_NAME} MODULE ${SRCS})
target_include_directories(${BIN_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${UDEV_INCLUDE_DIRS}
${POLKIT_QT_INCLUDE_DIRS}
)

target_link_libraries(${BIN_NAME} PRIVATE
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::DBus
Dtk${DTK_VERSION_MAJOR}::Core
${UDEV_LIBRARIES}
${POLKIT_QT_LIBRARIES}
)

install(TARGETS ${BIN_NAME}
Expand Down
14 changes: 14 additions & 0 deletions src/plugin-qt/power/system/misc/dbus/org.deepin.dde.Power1.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
<!-- Only root can own the service -->
<policy user="root">
<allow own="org.deepin.dde.Power1"/>
<allow send_destination="org.deepin.dde.Power1"
send_interface="org.deepin.dde.Power1"
send_member="SetAllowCaller"/>
</policy>

<!-- Only root and deepin-daemon group can call SetAllowCaller. -->
<policy group="deepin-daemon">
<allow send_destination="org.deepin.dde.Power1"
send_interface="org.deepin.dde.Power1"
send_member="SetAllowCaller"/>
</policy>

<!-- Preserve the legacy user-facing Power1 mode and battery API used by DCC.
Expand All @@ -34,6 +44,10 @@
<allow send_destination="org.deepin.dde.Power1.Battery"
send_interface="org.freedesktop.DBus.Introspectable"/>

<deny send_destination="org.deepin.dde.Power1"
send_interface="org.deepin.dde.Power1"
send_member="SetAllowCaller"/>

</policy>

</busconfig>
Loading
Loading