summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorWilliam Jon McCann <mccann@jhu.edu>2008-01-22 17:03:46 -0500
committerWilliam Jon McCann <mccann@jhu.edu>2008-01-22 17:43:22 -0500
commit5ce97e6f22fd25279793fbc75211d2e86413ae73 (patch)
tree5de0565516b1d90ed382dc5f0ed969c8e512706c /data
parent2fba24e67597bf59ae00db2867df7a348c81b094 (diff)
initial stop/restart support
Add Stop and Restart methods to the Manager object. We'll rename the Manager object to System in the near future. Use libpolkit to determine authorization.
Diffstat (limited to 'data')
-rw-r--r--data/ConsoleKit.policy48
-rw-r--r--data/Makefile.am4
2 files changed, 52 insertions, 0 deletions
diff --git a/data/ConsoleKit.policy b/data/ConsoleKit.policy
new file mode 100644
index 0000000..fea8737
--- /dev/null
+++ b/data/ConsoleKit.policy
@@ -0,0 +1,48 @@
+<?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 ConsoleKit
+-->
+
+<policyconfig>
+
+ <action id="org.freedesktop.consolekit.system.stop">
+ <description>Stop the system</description>
+ <message>System policy prevents stopping the system</message>
+ <defaults>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>yes</allow_active>
+ </defaults>
+ </action>
+
+ <action id="org.freedesktop.consolekit.system.stop-multiple-sessions">
+ <description>Stop the system when multiple users are logged in</description>
+ <message>System policy prevents stopping the when other users are logged in</message>
+ <defaults>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>auth_admin</allow_active>
+ </defaults>
+ </action>
+
+ <action id="org.freedesktop.consolekit.system.restart">
+ <description>Restart the system</description>
+ <message>System policy prevents restarting the system</message>
+ <defaults>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>yes</allow_active>
+ </defaults>
+ </action>
+
+ <action id="org.freedesktop.consolekit.system.restart-multiple-sessions">
+ <description>Restart the system when multiple users are logged in</description>
+ <message>System policy prevents restarting the system when other users are logged in</message>
+ <defaults>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>auth_admin</allow_active>
+ </defaults>
+ </action>
+
+</policyconfig>
diff --git a/data/Makefile.am b/data/Makefile.am
index e2a237b..dc1bf1a 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -6,6 +6,10 @@ dbusconf_DATA = ConsoleKit.conf
seatdir = $(sysconfdir)/ConsoleKit/seats.d
seat_DATA = 00-primary.seat
+polkit_policydir = $(datadir)/PolicyKit/policy
+dist_polkit_policy_DATA = \
+ ConsoleKit.policy \
+ $(NULL)
servicedir = $(datadir)/dbus-1/system-services
service_in_files = org.freedesktop.ConsoleKit.service.in