summaryrefslogtreecommitdiff
path: root/panels/common
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2012-08-22 14:15:04 +0100
committerBastien Nocera <hadess@hadess.net>2012-08-22 14:16:46 +0100
commit4d62e05fb088d64c3133912f0995a42157b8e968 (patch)
treebd73bcff1536860a66d704f593e515546bc3abf5 /panels/common
parentd2aa0ce5d8c93e777d201da779f13802e5249c95 (diff)
downloadgnome-control-center-4d62e05fb088d64c3133912f0995a42157b8e968.tar.gz
common: Add Policykit rules for hostname setting
Allow setting the computer's pretty hostname if the user is an admin. https://bugzilla.gnome.org/show_bug.cgi?id=679281
Diffstat (limited to 'panels/common')
-rw-r--r--panels/common/Makefile.am5
-rw-r--r--panels/common/gnome-control-center.rules8
2 files changed, 13 insertions, 0 deletions
diff --git a/panels/common/Makefile.am b/panels/common/Makefile.am
index 6ed8e6c40..b68a82ef7 100644
--- a/panels/common/Makefile.am
+++ b/panels/common/Makefile.am
@@ -36,4 +36,9 @@ uidir = $(pkgdatadir)/ui
dist_ui_DATA = \
language-chooser.ui
+rulesdir = $(datadir)/polkit-1/rules.d/
+rules_DATA = gnome-control-center.rules
+
+EXTRA_DIST = $(rules_DATA)
+
-include $(top_srcdir)/git.mk
diff --git a/panels/common/gnome-control-center.rules b/panels/common/gnome-control-center.rules
new file mode 100644
index 000000000..b141312af
--- /dev/null
+++ b/panels/common/gnome-control-center.rules
@@ -0,0 +1,8 @@
+polkit.addRule(function(action, subject) {
+ if (action.id == "org.freedesktop.hostname1.set-static-hostname" &&
+ subject.local &&
+ subject.active &&
+ subject.isInGroup ("wheel")) {
+ return polkit.Result.YES;
+ }
+});