polkit: add rule to allow agl-driver to control agl-app@ systemd services
[AGL/meta-agl.git] / meta-app-framework / recipes-config / polkit-rule-agl-app / files / 50-agl-app.rules
diff --git a/meta-app-framework/recipes-config/polkit-rule-agl-app/files/50-agl-app.rules b/meta-app-framework/recipes-config/polkit-rule-agl-app/files/50-agl-app.rules
new file mode 100644 (file)
index 0000000..5fa34fb
--- /dev/null
@@ -0,0 +1,7 @@
+polkit.addRule(function(action, subject) {
+    if (action.id == "org.freedesktop.systemd1.manage-units" &&
+        action.lookup("unit").indexOf("agl-app@") == 0 &&
+        subject.user == "agl-driver") {
+        return polkit.Result.YES;
+    }
+});