From bc56bb7546dc49178100eab4b82fcc2bb4e87e48 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 18 Nov 2013 18:01:07 +0100 Subject: polkit: Add some examples --- nixos/modules/security/polkit.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/security/polkit.nix b/nixos/modules/security/polkit.nix index e81a4d95f05..dbec4ad98d1 100644 --- a/nixos/modules/security/polkit.nix +++ b/nixos/modules/security/polkit.nix @@ -23,7 +23,15 @@ in default = ""; example = '' - TODO + /* Log authorization checks. */ + polkit.addRule(function(action, subject) { + polkit.log("user " + subject.user + " is attempting action " + action.id + " from PID " + subject.pid); + }); + + /* Allow any local user to do anything (dangerous!). */ + polkit.addRule(function(action, subject) { + if (subject.local) return "yes"; + }); ''; description = '' -- cgit 1.4.1