diff options
-rw-r--r-- | policy/Makefile.am | 2 | ||||
-rw-r--r-- | policy/org.freedesktop.devicekit.power.policy.in | 36 | ||||
-rw-r--r-- | policy/org.freedesktop.devicekit.power.qos.policy.in | 58 | ||||
-rw-r--r-- | src/dkp-qos.c | 6 | ||||
-rw-r--r-- | src/org.freedesktop.DeviceKit.Power.QoS.xml | 8 |
5 files changed, 66 insertions, 44 deletions
diff --git a/policy/Makefile.am b/policy/Makefile.am index 9db887a..cbcd4c9 100644 --- a/policy/Makefile.am +++ b/policy/Makefile.am @@ -1,5 +1,5 @@ polkit_policydir = $(datadir)/PolicyKit/policy -dist_polkit_policy_DATA = org.freedesktop.devicekit.power.policy +dist_polkit_policy_DATA = org.freedesktop.devicekit.power.policy org.freedesktop.devicekit.power.qos.policy # You will need a recent intltool or the patch from this bug # http://bugzilla.gnome.org/show_bug.cgi?id=462312 diff --git a/policy/org.freedesktop.devicekit.power.policy.in b/policy/org.freedesktop.devicekit.power.policy.in index 8b76348..f3bfec8 100644 --- a/policy/org.freedesktop.devicekit.power.policy.in +++ b/policy/org.freedesktop.devicekit.power.policy.in @@ -37,40 +37,4 @@ file are instantly applied. </defaults> </action> - <action id="org.freedesktop.devicekit.power.latency.request-latency"> - <_description>Set the required latency of an application</_description> - <_message>Authentication is required to set the required latency of an application</_message> - <defaults> - <allow_inactive>no</allow_inactive> - <allow_active>yes</allow_active> - </defaults> - </action> - - <action id="org.freedesktop.devicekit.power.latency.request-latency-persistent"> - <_description>Set a persistent latency setting</_description> - <_message>Authentication is required to set a persistent latency setting</_message> - <defaults> - <allow_inactive>no</allow_inactive> - <allow_active>yes</allow_active> - </defaults> - </action> - - <action id="org.freedesktop.devicekit.power.latency.set-minimum-latency"> - <_description>Set administrator settings for latency control</_description> - <_message>Authentication is required to set administrator settings for latency control</_message> - <defaults> - <allow_inactive>no</allow_inactive> - <allow_active>auth_admin</allow_active> - </defaults> - </action> - - <action id="org.freedesktop.devicekit.power.latency.cancel-request"> - <_description>Cancel a latency request</_description> - <_message>Authentication is required to cancel a latency request</_message> - <defaults> - <allow_inactive>no</allow_inactive> - <allow_active>auth_admin</allow_active> - </defaults> - </action> - </policyconfig> diff --git a/policy/org.freedesktop.devicekit.power.qos.policy.in b/policy/org.freedesktop.devicekit.power.qos.policy.in new file mode 100644 index 0000000..f24821a --- /dev/null +++ b/policy/org.freedesktop.devicekit.power.qos.policy.in @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!DOCTYPE policyconfig PUBLIC + "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" + "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd"> + +<!-- +Policy definitions for DeviceKit-power + +Copyright (c) 2008 David Zeuthen <david@fubar.dk> + +NOTE: If you make changes to this file, make sure to validate the file +using the polkit-policy-file-validate(1) tool. Changes made to this +file are instantly applied. +--> + +<policyconfig> + <vendor>The DeviceKit-power Project</vendor> + <vendor_url>http://hal.freedesktop.org/docs/DeviceKit-power/</vendor_url> + <icon_name>system-suspend</icon_name> + + <action id="org.freedesktop.devicekit.power.qos.request-latency"> + <_description>Set the required latency of an application</_description> + <_message>Authentication is required to set the required latency of an application</_message> + <defaults> + <allow_inactive>no</allow_inactive> + <allow_active>yes</allow_active> + </defaults> + </action> + + <action id="org.freedesktop.devicekit.power.qos.request-latency-persistent"> + <_description>Set a persistent latency setting</_description> + <_message>Authentication is required to set a persistent latency setting</_message> + <defaults> + <allow_inactive>no</allow_inactive> + <allow_active>yes</allow_active> + </defaults> + </action> + + <action id="org.freedesktop.devicekit.power.qos.set-minimum-latency"> + <_description>Set administrator settings for latency control</_description> + <_message>Authentication is required to set administrator settings for latency control</_message> + <defaults> + <allow_inactive>no</allow_inactive> + <allow_active>auth_admin</allow_active> + </defaults> + </action> + + <action id="org.freedesktop.devicekit.power.qos.cancel-request"> + <_description>Cancel a latency request</_description> + <_message>Authentication is required to cancel a latency request</_message> + <defaults> + <allow_inactive>no</allow_inactive> + <allow_active>auth_admin</allow_active> + </defaults> + </action> + +</policyconfig> diff --git a/src/dkp-qos.c b/src/dkp-qos.c index 6ed3f96..27abc2d 100644 --- a/src/dkp-qos.c +++ b/src/dkp-qos.c @@ -324,9 +324,9 @@ dkp_qos_request_latency (DkpQos *qos, const gchar *type_text, gint value, gboole /* check auth */ if (persistent) - auth = "org.freedesktop.devicekit.power.latency.request-latency-persistent"; + auth = "org.freedesktop.devicekit.power.qos.request-latency-persistent"; else - auth = "org.freedesktop.devicekit.power.latency.request-latency"; + auth = "org.freedesktop.devicekit.power.qos.request-latency"; if (!dkp_polkit_check_auth (qos->priv->polkit, caller, auth, context)) goto out; @@ -427,7 +427,7 @@ dkp_qos_cancel_request (DkpQos *qos, guint cookie, DBusGMethodInvocation *contex caller = dkp_polkit_get_caller (qos->priv->polkit, context); if (caller == NULL) goto out; - if (!dkp_polkit_check_auth (qos->priv->polkit, caller, "org.freedesktop.devicekit.power.latency.cancel-request", context)) + if (!dkp_polkit_check_auth (qos->priv->polkit, caller, "org.freedesktop.devicekit.power.qos.cancel-request", context)) goto out; } diff --git a/src/org.freedesktop.DeviceKit.Power.QoS.xml b/src/org.freedesktop.DeviceKit.Power.QoS.xml index 2009d92..716eb06 100644 --- a/src/org.freedesktop.DeviceKit.Power.QoS.xml +++ b/src/org.freedesktop.DeviceKit.Power.QoS.xml @@ -97,7 +97,7 @@ You do not have to use this method during normal operation. </doc:para> </doc:description> - <doc:permission>Callers need the <doc:tt>org.freedesktop.devicekit.power.latency.set-minimum-latency</doc:tt> authorization</doc:permission> + <doc:permission>Callers need the <doc:tt>org.freedesktop.devicekit.power.qos.set-minimum-latency</doc:tt> authorization</doc:permission> <doc:errors> <doc:error name="&ERROR_GENERAL;">if an error occured while setting the latency</doc:error> </doc:errors> @@ -151,9 +151,9 @@ </doc:description> <doc:permission> Callers need the - <doc:tt>org.freedesktop.devicekit.power.latency.request-latency-persistent</doc:tt> + <doc:tt>org.freedesktop.devicekit.power.qos.request-latency-persistent</doc:tt> authorization if <doc:tt>persistent</doc:tt> is TRUE, or - <doc:tt>org.freedesktop.devicekit.power.latency.request-latency</doc:tt> otherwise. + <doc:tt>org.freedesktop.devicekit.power.qos.request-latency</doc:tt> otherwise. </doc:permission> <doc:errors> <doc:error name="&ERROR_GENERAL;">if an error occured while setting the latency</doc:error> @@ -188,7 +188,7 @@ </doc:description> <doc:permission> Callers need the - <doc:tt>org.freedesktop.devicekit.power.latency.cancel-request</doc:tt> + <doc:tt>org.freedesktop.devicekit.power.qos.cancel-request</doc:tt> authorization if they were not the one issuing the request. </doc:permission> <doc:errors> |