polkit.addRule(function(action, subject) { var idx = action.id.lastIndexOf('.'); var username_stripped = action.id.substring(0, idx); var username = action.id.substring(idx + 1); if (username_stripped === "mko.cpupower.setcpufreq") { if (subject.user === username) { return polkit.Result.YES; } else { return polkit.Result.NO; } } });