Why do Polkit rules have these numbers in front?

some programs like virt-manager, as well as mounting and decrypting LUKS drives requires root permissions, with a polkit dialog showing up.

KDE is awesome, so I could just display the exact process requesting that access, and I made a small script, automating the creation of polkit rules

But now I wonder, there always seems to be a really strict naming scheme, with numbers like 50 or 80 at the beginning. Is that important?

My created rules work really well, but maybe they are executed too often, or have a different problem?

According to the polkit documentation, numeric prefixes determine the order in which rules are processed.
Although it is recommended to use numeric prefixes, most of the preinstalled rules in /usr/share/polkit-1/rules.d have none, so using any numeric prefix for custom rules elevates their priority above the others.
This indicates that the rule priority is irrelevant unless you want to override the defaults.
As far as I understand, there shouldn’t be any performance drawback as long as you don’t create huge rules sizable in megabytes of text.

1 Like