diff options
author | Eric Koegel <eric.koegel@gmail.com> | 2014-10-20 14:26:27 +0300 |
---|---|---|
committer | Eric Koegel <eric.koegel@gmail.com> | 2014-10-20 14:43:16 +0300 |
commit | 5660e2c036463e899fb0da69297e88cf1bb6bbd8 (patch) | |
tree | 57cd41764eceea670ac4ed1271103afebcbe679f /data | |
parent | b15fb852e6badc1f162cc25b4364763a473f9884 (diff) | |
download | ConsoleKit2-5660e2c036463e899fb0da69297e88cf1bb6bbd8.tar.gz |
Add HybridSleep support and change CanSleep
Emulate the logind API to make it more easier for porting to
ConsoleKit2 for the CanSuspend/CanHibernate/CanHybridSleep methods.
They now return:
yes - system can and user explicitly authorized by polkit, rbac, or neither is running
no - system can and user explicitly unauthorized by polkit or rbac
challenge - system can and user requires elevation via polkit
na - system does not support it (hardware or backend support missing).
The auth methods have been removed.
Currently HybridSleep only works on Linux.
Diffstat (limited to 'data')
-rw-r--r-- | data/ConsoleKit.conf | 8 | ||||
-rw-r--r-- | data/org.freedesktop.consolekit.policy | 20 |
2 files changed, 23 insertions, 5 deletions
diff --git a/data/ConsoleKit.conf b/data/ConsoleKit.conf index 35c79a8..2b05219 100644 --- a/data/ConsoleKit.conf +++ b/data/ConsoleKit.conf @@ -44,16 +44,16 @@ send_member="CanSuspend"/> <allow send_destination="org.freedesktop.ConsoleKit" send_interface="org.freedesktop.ConsoleKit.Manager" - send_member="AuthSuspend"/> - <allow send_destination="org.freedesktop.ConsoleKit" - send_interface="org.freedesktop.ConsoleKit.Manager" send_member="Hibernate"/> <allow send_destination="org.freedesktop.ConsoleKit" send_interface="org.freedesktop.ConsoleKit.Manager" send_member="CanHibernate"/> <allow send_destination="org.freedesktop.ConsoleKit" send_interface="org.freedesktop.ConsoleKit.Manager" - send_member="AuthHibernate"/> + send_member="HybridSleep"/> + <allow send_destination="org.freedesktop.ConsoleKit" + send_interface="org.freedesktop.ConsoleKit.Manager" + send_member="CanHybridSleep"/> <allow send_destination="org.freedesktop.ConsoleKit" send_interface="org.freedesktop.ConsoleKit.Manager" send_member="Inhibit"/> diff --git a/data/org.freedesktop.consolekit.policy b/data/org.freedesktop.consolekit.policy index 76a6cc8..3898d9a 100644 --- a/data/org.freedesktop.consolekit.policy +++ b/data/org.freedesktop.consolekit.policy @@ -63,7 +63,7 @@ Policy definitions for ConsoleKit </defaults> </action> - <action id="org.freedesktop.consolekit.system.hibernate"> + <action id="org.freedesktop.consolekit.system.hibernate"> <description>Hibernate the system</description> <message>System policy prevents hibernating the system</message> <defaults> @@ -80,4 +80,22 @@ Policy definitions for ConsoleKit <allow_active>auth_admin_keep</allow_active> </defaults> </action> + + <action id="org.freedesktop.consolekit.system.hybridsleep"> + <description>Hybrid sleep the system (sleep + hibernate)</description> + <message>System policy prevents hybrid sleeping the system</message> + <defaults> + <allow_inactive>no</allow_inactive> + <allow_active>yes</allow_active> + </defaults> + </action> + + <action id="org.freedesktop.consolekit.system.hybridsleep-multiple-users"> + <description>Hybrid sleep the system (sleep + hibernate) when multiple users are logged in</description> + <message>System policy prevents hybrid sleeping the system when other users are logged in</message> + <defaults> + <allow_inactive>no</allow_inactive> + <allow_active>auth_admin_keep</allow_active> + </defaults> + </action> </policyconfig> |