Browse Source

Add new verbs to the polkit rule

pull/49/head
Rodolphe Bréard 4 years ago
parent
commit
9a52340303
  1. 6
      CHANGELOG.md
  2. 3
      contrib/10-acmed.rules

6
CHANGELOG.md

@ -12,6 +12,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- In addition to `restart`, the Polkit rule also allows the `reload`, `try-restart`, `reload-or-restart` and `try-reload-or-restart` verbs.
## [0.17.0] - 2020-05-04 ## [0.17.0] - 2020-05-04
### Added ### Added

3
contrib/10-acmed.rules

@ -11,7 +11,8 @@
polkit.addRule(function(action, subject) { polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.systemd1.manage-units") { if (action.id == "org.freedesktop.systemd1.manage-units") {
if (subject.user == "acmed") { if (subject.user == "acmed") {
if (action.lookup("verb") == "restart") {
var verb = action.lookup("verb");
if (verb == "reload" || verb == "restart" || verb == "try-restart" || verb == "reload-or-restart" || verb == "try-reload-or-restart") {
return polkit.Result.YES; return polkit.Result.YES;
} }
} }

Loading…
Cancel
Save