Commit 4d62e05f authored by Matthias Clasen's avatar Matthias Clasen Committed by Bastien Nocera
Browse files

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
parent d2aa0ce5
......@@ -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
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;
}
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment