Skip to content

Instantly share code, notes, and snippets.

@floitsch
Created February 24, 2025 14:15
Show Gist options
  • Save floitsch/64165e01f7630489e74c21621b6ff75f to your computer and use it in GitHub Desktop.
Save floitsch/64165e01f7630489e74c21621b6ff75f to your computer and use it in GitHub Desktop.
Allow access to smartcards for users in group smartcard-access. (Ubuntu 24.04)
// /etc/polkit-1/rules.d/50-smartcard-access.rules
// Uses the group 'smartcard-access' to determine whether one has access.
polkit.addRule(function(action, subject) {
if ((action.id == "org.debian.pcsc-lite.access_pcsc" || action.id == "org.debian.pcsc-lite.access_card") &&
subject.isInGroup("smartcard-access")) {
return polkit.Result.YES;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment