mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
networks: Add polkit rules for network management
Allow Plinth to manage network connections even when running as 'plinth' user and not root user. This is done by adding polkit rules that Network Manager checks - Add new style Javascript based rules file for newer versions of polkit (>105). This is not fuly tested. - Add old style .pkla file for older versions of polkit (<=105).
This commit is contained in:
1 parent
38d99ff5ff
commit
5a04d8057e
4 files changed
+36
-1
No files matched your search
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
*/
|
||||
|
||||
polkit.addRule(function(action, subject) {
|
||||
if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 &&
|
||||
subject.user == "plinth") {
|
||||
return polkit.Result.YES;
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user