Add a set of polkit rules that allow active users belonging to
the plugdev group to perform network setup actions via blueman. This
resembles the rules used by NetworkManager.
Bug: https://bugs.gentoo.org/show_bug.cgi?id=584300
src_install() {
default
+ if use policykit; then
+ # Allow users in plugdev group to modify connections
+ insinto /usr/share/polkit-1/rules.d
+ doins "${FILESDIR}/01-org.blueman.rules"
+ fi
+
python_fix_shebang "${D}"
rm "${D}"/$(python_get_sitedir)/*.la || die
}
--- /dev/null
+// Let users in plugdev group modify network connections using blueman
+polkit.addRule(function(action, subject) {
+ if ((action.id == "org.blueman.network.setup" ||
+ action.id == "org.blueman.dhcp.client" ||
+ action.id == "org.blueman.rfkill.setstate" ||
+ action.id == "org.blueman.pppd.pppconnect") &&
+ subject.isInGroup("plugdev") && subject.active) {
+
+ return polkit.Result.YES;
+ }
+});