Scope polkit actions to require the privileged group

This commit is contained in:
Kira Bruneau
2022-07-27 19:32:18 -04:00
committed by afayaz-feral
parent 898ab01924
commit 337f1b8a8e
4 changed files with 32 additions and 10 deletions

View File

@@ -0,0 +1,12 @@
/*
* Allow users in privileged gamemode group to run cpugovctl &
* gpuclockctl without authentication
*/
polkit.addRule(function (action, subject) {
if ((action.id == "com.feralinteractive.GameMode.governor-helper" ||
action.id == "com.feralinteractive.GameMode.gpu-helper") &&
subject.isInGroup("@GAMEMODE_PRIVILEGED_GROUP@"))
{
return polkit.Result.YES;
}
});