diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2010-02-08 17:46:11 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2010-02-09 10:42:36 +0000 |
commit | b93915a377c9acbd26fb3c1f7bd9b41d76e4b578 (patch) | |
tree | dce50d0897ecc5b724985076207d9d744044e25c /src/org.freedesktop.UPower.xml | |
parent | a057e36751aa7885c9ce9fc43cad4e975498fc60 (diff) | |
download | upower-b93915a377c9acbd26fb3c1f7bd9b41d76e4b578.tar.gz |
Add {Suspend,Hibernate}Allowed D-Bus methods
Add two D-Bus server methods to check whether the caller has the privilege to
suspend or hibernate.
This enables us to check for PK privileges in UpClient's
can_{suspend,hibernate} properties, so that clients like gnome-session or
gnome-power-manager hide the suspend/hibernate related actions if the admin or
OEM disabled suspend/hibernate through a PolicyKit .pkla file.
https://bugs.freedesktop.org/show_bug.cgi?id=26473
Diffstat (limited to 'src/org.freedesktop.UPower.xml')
-rw-r--r-- | src/org.freedesktop.UPower.xml | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/org.freedesktop.UPower.xml b/src/org.freedesktop.UPower.xml index cf32edc..a4066ff 100644 --- a/src/org.freedesktop.UPower.xml +++ b/src/org.freedesktop.UPower.xml @@ -195,6 +195,23 @@ method return sender=:1.386 -> dest=:1.451 reply_serial=2 <!-- ************************************************************ --> + <method name="SuspendAllowed"> + <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> + <arg name="allowed" direction="out" type="b"> + <doc:doc><doc:summary>TRUE if allowed, otherwise FALSE</doc:summary></doc:doc> + </arg> + <doc:doc> + <doc:description> + <doc:para> + Check if the caller has (or can get) the PolicyKit privilege to call + <doc:ref type="method" to="Power.Suspend">Suspend</doc:ref>. + </doc:para> + </doc:description> + </doc:doc> + </method> + + <!-- ************************************************************ --> + <method name="Hibernate"> <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> <doc:doc> @@ -216,6 +233,22 @@ method return sender=:1.386 -> dest=:1.451 reply_serial=2 </doc:doc> </method> + <!-- ************************************************************ --> + + <method name="HibernateAllowed"> + <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> + <arg name="allowed" direction="out" type="b"> + <doc:doc><doc:summary>TRUE if allowed, otherwise FALSE</doc:summary></doc:doc> + </arg> + <doc:doc> + <doc:description> + <doc:para> + Check if the caller has (or can get) the PolicyKit privilege to call + <doc:ref type="method" to="Power.Hibernate">Hibernate</doc:ref>. + </doc:para> + </doc:description> + </doc:doc> + </method> <!-- ************************************************************ --> |