Patchwork [meta-gnome/meta-oe/meta-xfce/V2,15/20] polkit-group-rule-datetime: initial add

login
register
mail settings
Submitter Andreas Müller
Date June 19, 2013, 5:29 p.m.
Message ID <1371662967-31734-16-git-send-email-schnitzeltony@googlemail.com>
Download mbox | patch
Permalink /patch/52051/
State Accepted
Commit 010f75a8d052251fee1bb2d42f926693fade962c
Headers show

Comments

Andreas Müller - June 19, 2013, 5:29 p.m.
add user-group 'datetime' allowing members to change date/time/timezone settings

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
---
 .../files/50-org.freedesktop.timedate1.rules       |    8 ++++++++
 .../polkit/polkit-group-rule-datetime.bb           |   14 ++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)
 create mode 100644 meta-oe/recipes-extended/polkit/files/50-org.freedesktop.timedate1.rules
 create mode 100644 meta-oe/recipes-extended/polkit/polkit-group-rule-datetime.bb

Patch

diff --git a/meta-oe/recipes-extended/polkit/files/50-org.freedesktop.timedate1.rules b/meta-oe/recipes-extended/polkit/files/50-org.freedesktop.timedate1.rules
new file mode 100644
index 0000000..95b0e0f
--- /dev/null
+++ b/meta-oe/recipes-extended/polkit/files/50-org.freedesktop.timedate1.rules
@@ -0,0 +1,8 @@ 
+/* give group 'datetime' rights to change settings */
+/* based upon http://lists.freedesktop.org/archives/systemd-devel/2013-March/009576.html */
+
+polkit.addRule(function(action, subject) {
+  if (action.id.indexOf("org.freedesktop.timedate1.") == 0 && subject.isInGroup("datetime")) {
+    return polkit.Result.YES;
+  }
+});
diff --git a/meta-oe/recipes-extended/polkit/polkit-group-rule-datetime.bb b/meta-oe/recipes-extended/polkit/polkit-group-rule-datetime.bb
new file mode 100644
index 0000000..373e4f0
--- /dev/null
+++ b/meta-oe/recipes-extended/polkit/polkit-group-rule-datetime.bb
@@ -0,0 +1,14 @@ 
+DESCRIPTION = "Create usergroup datetime. All members off this group are allowed set date/time/timezone via system dbus"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
+
+require polkit-group-rule.inc
+
+SRC_URI = "file://50-org.freedesktop.timedate1.rules"
+
+do_install() {
+        install -m 0755 ${WORKDIR}/50-org.freedesktop.timedate1.rules ${D}${sysconfdir}/polkit-1/rules.d
+}
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system datetime"