You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
360 B

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 === "{{RULE_BASE}}") {
if (subject.user === username) {
return polkit.Result.YES;
} else {
return polkit.Result.NO;
}
}
});