10 lines
394 B
Plaintext
10 lines
394 B
Plaintext
|
|
polkit.addRule(function(action, subject) {
|
||
|
|
// 输出 action.id 和 user 信息
|
||
|
|
//polkit.log('Checking action: ' + action.id);
|
||
|
|
//polkit.log('User: ' + subject.user);
|
||
|
|
if (action.id == "org.freedesktop.policykit.exec" &&
|
||
|
|
/^\/(usr\/)?bin\/(systemctl|bash|influx_inspect|influx|influxd)$/.test(action.lookup("program"))) {
|
||
|
|
return polkit.Result.YES; // 直接允许
|
||
|
|
}
|
||
|
|
});
|