servo: shelvacu: allow to start/stop/restart units
This commit is contained in:
@@ -37,6 +37,28 @@
|
||||
}
|
||||
];
|
||||
|
||||
security.polkit.extraConfig = ''
|
||||
// allow:
|
||||
// - systemctl restart|start|stop SERVICE
|
||||
polkit.addRule(function(action, subject) {
|
||||
if (subject.user == "shelvacu" && action.id == "org.freedesktop.systemd1.manage-units") {
|
||||
switch (action.lookup("verb")) {
|
||||
// case "cancel":
|
||||
// case "reenable":
|
||||
case "restart":
|
||||
// case "reload":
|
||||
// case "reload-or-restart":
|
||||
case "start":
|
||||
case "stop":
|
||||
// case "try-reload-or-restart":
|
||||
// case "try-restart":
|
||||
return polkit.Result.YES;
|
||||
default:
|
||||
}
|
||||
}
|
||||
})
|
||||
'';
|
||||
|
||||
sane.persist.sys.byStore.private = [
|
||||
{ path = "/home/shelvacu/persist"; user = "shelvacu"; group = "users"; mode = "0700"; }
|
||||
];
|
||||
|
Reference in New Issue
Block a user