add user-group 'datetime' allowing members to change date/time/timezone settings
(From meta-openembedded rev:
010f75a8d052251fee1bb2d42f926693fade962c)
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
--- /dev/null
+/* 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;
+ }
+});
--- /dev/null
+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"