mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-02-04 07:10:25 +01:00
trivial: mae the PolicyKit file validate
This commit is contained in:
parent
43f1ae2668
commit
09be8aeefb
5 changed files with 66 additions and 44 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
58
policy/org.freedesktop.devicekit.power.qos.policy.in
Normal file
58
policy/org.freedesktop.devicekit.power.qos.policy.in
Normal file
|
|
@ -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>
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue