├── .gitignore
├── PKEIconV001.png
├── polkitex.desktop
├── compile_forms.sh
├── LICENSE
├── README.md
├── Ui_Glossary.py
├── Glossary.ui
├── Ui_About.py
├── About.ui
├── polkitex.py
├── Ui_polkitex.py
└── polkitex.ui
/.gitignore:
--------------------------------------------------------------------------------
1 | *.pyc
2 |
--------------------------------------------------------------------------------
/PKEIconV001.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scarygliders/Polkit-Explorer/HEAD/PKEIconV001.png
--------------------------------------------------------------------------------
/polkitex.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Encoding=UTF-8
3 | Type=Application
4 | Name=Polkit-explorer
5 | Comment=Present PolicyKit information in a human-readable form.
6 | Exec=polkitex
7 | Icon=emblem-system
8 | Terminal=false
9 | StartupNotify=false
10 | Categories=System;
11 |
--------------------------------------------------------------------------------
/compile_forms.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | echo "Compiling the UI files..."
4 | echo "About..."
5 | pyside6-uic About.ui -o Ui_About.py
6 | echo "Glossary..."
7 | pyside6-uic Glossary.ui -o Ui_Glossary.py
8 | echo "Polkit Explorer..."
9 | pyside6-uic polkitex.ui -o Ui_polkitex.py
10 | echo "Done."
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (C) 2013, Kevin Cave
2 |
3 | ISC License (ISC)
4 |
5 | Permission to use, copy, modify, and/or distribute this software for any purpose with
6 | or without fee is hereby granted, provided that the above copyright notice and this
7 | permission notice appear in all copies.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO
10 | THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
11 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
12 | DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
13 | AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
14 | WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Polkit Explorer
2 | ---------------
3 |
4 | Polkit Explorer reads in a Polkit .policy file, parses its XML contents, and
5 | presents the information it contains, on a more human-readable GUI window.
6 |
7 | Polkit policies define what the default permissions users are given to perform
8 | certain tasks on their systems, for example, can a user eject a disk. These
9 | permissions are granted or denied depending on if a user is logged in locally
10 | (Active) , logged in remotely (Inactive), or just plain logged in.
11 |
12 | This utility is intended to give you an insight into how your system is
13 | configured by default.
14 |
15 | Written in Python using the QT5 library.
16 |
17 | Requires
18 | --------
19 | python3 (tested on python 3.12)
20 | pyside6
21 | python-lxml
22 | Qt libraries (whatever PySide6 needs)
23 |
24 | Running
25 | -------
26 |
27 | To run:
28 | 0) Ensure your Python environment is set up. Tested on 3.12. Either use a virtualenv with pyside6 installed, or
29 | install the native python packages on your system. Your virtualenv should have pyside6 and python-lxml installed.
30 | 1) ensure the Ui_*.py files exist. If not, first run the compile_forms.sh shell script which will create them.
31 | 2) type ./polkitex.py (or python polkitex.py)
32 |
33 | Polkit Explorer should now display the main window. Click on File-->Open and select a policy file, after which you
34 | will be able to view the policies configured for that particular file using the drop-down menu.
35 |
36 |
37 |
38 | Menus
39 | -----
40 |
41 | Use File--->Open from the GUI to open the .policy file you wish to explore.
42 |
43 | File--->Quit exits the application.
44 |
45 | Help--->About brings up the About window.
46 |
47 | Help--->Glossary brings up a window explaining the meanings of the information
48 | displayed.
49 |
50 | More details at http://scarygliders.net/2013/03/26/polkit-explorer-v1-0-released/
51 |
52 | Tested on Debian, Arch Linux, and works. For other distributions you may have to browse to a
53 | different directory where that particular distribution keeps its Polkit .policy
54 | files.
55 |
56 | Send patches, bug reports either to the GitHub repository.
57 | My much-neglected website is at: http://scarygliders.net
58 |
59 | Files
60 | -----
61 |
62 | About.ui : Qtdesigner file for the About window
63 |
64 | Glossary.ui : QtDesigner file for the Glossary window
65 |
66 | PKEIconV001.png : The program's "logo"
67 |
68 | polkitex.py : The main Python program
69 |
70 | polkitex.ui : QtDesigner file for the main GUI
71 |
72 | Ui_*.py : Python code, compiled from the *.ui files using pyside6-uic
73 |
74 | Any changes made to the .ui QtDesigner forms need to then be compiled via pyside6-uic.
75 | A shell script called compile_forms.sh is provided for your convenience. Run that
76 | first before trying to run the application.
77 |
78 | Signal slots from the buttons to the main program are created inside QtDesigner.
79 |
80 | Python will more than likely create some .pyc files after running this, it's
81 | normal (compiled python files).
82 |
83 | I hope this proves useful to someone.
84 |
85 | Enjoy ;)
86 |
87 | Kevin Cave
88 | kevin@scarygliders.net
89 |
--------------------------------------------------------------------------------
/Ui_Glossary.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | ################################################################################
4 | ## Form generated from reading UI file 'Glossary.ui'
5 | ##
6 | ## Created by: Qt User Interface Compiler version 6.8.0
7 | ##
8 | ## WARNING! All changes made in this file will be lost when recompiling UI file!
9 | ################################################################################
10 |
11 | from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
12 | QMetaObject, QObject, QPoint, QRect,
13 | QSize, QTime, QUrl, Qt)
14 | from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
15 | QFont, QFontDatabase, QGradient, QIcon,
16 | QImage, QKeySequence, QLinearGradient, QPainter,
17 | QPalette, QPixmap, QRadialGradient, QTransform)
18 | from PySide6.QtWidgets import (QApplication, QDialog, QFrame, QLabel,
19 | QPushButton, QSizePolicy, QWidget)
20 |
21 | class Ui_Glossary(object):
22 | def setupUi(self, Glossary):
23 | if not Glossary.objectName():
24 | Glossary.setObjectName(u"Glossary")
25 | Glossary.setWindowModality(Qt.WindowModality.WindowModal)
26 | Glossary.resize(1018, 520)
27 | sizePolicy = QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
28 | sizePolicy.setHorizontalStretch(0)
29 | sizePolicy.setVerticalStretch(0)
30 | sizePolicy.setHeightForWidth(Glossary.sizePolicy().hasHeightForWidth())
31 | Glossary.setSizePolicy(sizePolicy)
32 | Glossary.setSizeGripEnabled(False)
33 | Glossary.setModal(False)
34 | self.label = QLabel(Glossary)
35 | self.label.setObjectName(u"label")
36 | self.label.setGeometry(QRect(460, 10, 81, 31))
37 | font = QFont()
38 | font.setPointSize(12)
39 | font.setBold(True)
40 | self.label.setFont(font)
41 | self.label.setFrameShape(QFrame.Shape.StyledPanel)
42 | self.label.setFrameShadow(QFrame.Shadow.Plain)
43 | self.label.setLineWidth(2)
44 | self.label.setTextInteractionFlags(Qt.TextInteractionFlag.LinksAccessibleByMouse)
45 | self.label_2 = QLabel(Glossary)
46 | self.label_2.setObjectName(u"label_2")
47 | self.label_2.setGeometry(QRect(10, 80, 1001, 391))
48 | font1 = QFont()
49 | font1.setFamilies([u"Monospace"])
50 | font1.setPointSize(12)
51 | font1.setBold(False)
52 | self.label_2.setFont(font1)
53 | self.label_2.setFrameShape(QFrame.Shape.StyledPanel)
54 | self.label_2.setFrameShadow(QFrame.Shadow.Sunken)
55 | self.label_2.setLineWidth(3)
56 | self.label_2.setAlignment(Qt.AlignmentFlag.AlignLeading|Qt.AlignmentFlag.AlignLeft|Qt.AlignmentFlag.AlignTop)
57 | self.glossaryClose = QPushButton(Glossary)
58 | self.glossaryClose.setObjectName(u"glossaryClose")
59 | self.glossaryClose.setGeometry(QRect(460, 480, 81, 29))
60 | self.glossaryClose.setFont(font)
61 |
62 | self.retranslateUi(Glossary)
63 | self.glossaryClose.clicked.connect(Glossary.closeGlossary)
64 |
65 | QMetaObject.connectSlotsByName(Glossary)
66 | # setupUi
67 |
68 | def retranslateUi(self, Glossary):
69 | Glossary.setWindowTitle(QCoreApplication.translate("Glossary", u"Glossary", None))
70 | self.label.setText(QCoreApplication.translate("Glossary", u"Glossary", None))
71 | self.label_2.setText(QCoreApplication.translate("Glossary", u"
Allow Any : Anyone logged in from anywhere
Allow Inactive : Users logged in remotely
Allow Active : Users logged in at a system terminal
no : Not authorized.
yes : Authorized.
auth_self : Authentication by the owner of the session that the client originates from is required.
auth_admin : Authentication by an administrative user is required.
auth_self_keep : Like auth_self but the authorization is kept for a brief period.
auth_admin_keep : Like auth_admin but the authorization is kept for a brief period.
", None))
72 | self.glossaryClose.setText(QCoreApplication.translate("Glossary", u"Close", None))
73 | # retranslateUi
74 |
75 |
--------------------------------------------------------------------------------
/Glossary.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | Glossary
4 |
5 |
6 | Qt::WindowModality::WindowModal
7 |
8 |
9 |
10 | 0
11 | 0
12 | 1018
13 | 520
14 |
15 |
16 |
17 |
18 | 0
19 | 0
20 |
21 |
22 |
23 | Glossary
24 |
25 |
26 | false
27 |
28 |
29 | false
30 |
31 |
32 |
33 |
34 | 460
35 | 10
36 | 81
37 | 31
38 |
39 |
40 |
41 |
42 | 12
43 | true
44 |
45 |
46 |
47 | QFrame::Shape::StyledPanel
48 |
49 |
50 | QFrame::Shadow::Plain
51 |
52 |
53 | 2
54 |
55 |
56 | Glossary
57 |
58 |
59 | Qt::TextInteractionFlag::LinksAccessibleByMouse
60 |
61 |
62 |
63 |
64 |
65 | 10
66 | 80
67 | 1001
68 | 391
69 |
70 |
71 |
72 |
73 | Monospace
74 | 12
75 | false
76 |
77 |
78 |
79 | QFrame::Shape::StyledPanel
80 |
81 |
82 | QFrame::Shadow::Sunken
83 |
84 |
85 | 3
86 |
87 |
88 | <html><head/><body><p>Allow Any : Anyone logged in from anywhere<br/><br/>Allow Inactive : Users logged in remotely<br/><br/>Allow Active : Users logged in at a system terminal</p><p><br/></p><p>no : Not authorized.<br/><br/>yes : Authorized.<br/><br/>auth_self : Authentication by the owner of the session that the client originates from is required.<br/><br/>auth_admin : Authentication by an administrative user is required.<br/><br/>auth_self_keep : Like auth_self but the authorization is kept for a brief period.<br/><br/>auth_admin_keep : Like auth_admin but the authorization is kept for a brief period.</p></body></html>
89 |
90 |
91 | Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop
92 |
93 |
94 |
95 |
96 |
97 | 460
98 | 480
99 | 81
100 | 29
101 |
102 |
103 |
104 |
105 | 12
106 | true
107 |
108 |
109 |
110 | Close
111 |
112 |
113 |
114 |
115 |
116 |
117 | glossaryClose
118 | clicked()
119 | Glossary
120 | closeGlossary()
121 |
122 |
123 | 509
124 | 494
125 |
126 |
127 | 663
128 | 494
129 |
130 |
131 |
132 |
133 |
134 | closeGlossary()
135 |
136 |
137 |
--------------------------------------------------------------------------------
/Ui_About.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | ################################################################################
4 | ## Form generated from reading UI file 'About.ui'
5 | ##
6 | ## Created by: Qt User Interface Compiler version 6.8.0
7 | ##
8 | ## WARNING! All changes made in this file will be lost when recompiling UI file!
9 | ################################################################################
10 |
11 | from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
12 | QMetaObject, QObject, QPoint, QRect,
13 | QSize, QTime, QUrl, Qt)
14 | from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
15 | QFont, QFontDatabase, QGradient, QIcon,
16 | QImage, QKeySequence, QLinearGradient, QPainter,
17 | QPalette, QPixmap, QRadialGradient, QTransform)
18 | from PySide6.QtWidgets import (QApplication, QFrame, QLabel, QPushButton,
19 | QSizePolicy, QWidget)
20 |
21 | class Ui_About(object):
22 | def setupUi(self, About):
23 | if not About.objectName():
24 | About.setObjectName(u"About")
25 | About.setWindowModality(Qt.WindowModality.NonModal)
26 | About.resize(400, 386)
27 | self.frame = QFrame(About)
28 | self.frame.setObjectName(u"frame")
29 | self.frame.setGeometry(QRect(9, 9, 381, 371))
30 | self.frame.setFrameShape(QFrame.Shape.StyledPanel)
31 | self.frame.setFrameShadow(QFrame.Shadow.Raised)
32 | self.frame.setLineWidth(1)
33 | self.label = QLabel(self.frame)
34 | self.label.setObjectName(u"label")
35 | self.label.setGeometry(QRect(40, 0, 281, 41))
36 | font = QFont()
37 | font.setPointSize(12)
38 | font.setBold(True)
39 | self.label.setFont(font)
40 | self.label.setFrameShape(QFrame.Shape.NoFrame)
41 | self.label.setLineWidth(3)
42 | self.label.setAlignment(Qt.AlignmentFlag.AlignCenter)
43 | self.label_2 = QLabel(self.frame)
44 | self.label_2.setObjectName(u"label_2")
45 | self.label_2.setGeometry(QRect(10, 260, 361, 71))
46 | self.label_2.setFrameShape(QFrame.Shape.StyledPanel)
47 | self.label_2.setFrameShadow(QFrame.Shadow.Raised)
48 | self.label_2.setTextFormat(Qt.TextFormat.RichText)
49 | self.label_2.setAlignment(Qt.AlignmentFlag.AlignLeading|Qt.AlignmentFlag.AlignLeft|Qt.AlignmentFlag.AlignTop)
50 | self.label_2.setWordWrap(True)
51 | self.label_2.setTextInteractionFlags(Qt.TextInteractionFlag.NoTextInteraction)
52 | self.closeAboutButton = QPushButton(self.frame)
53 | self.closeAboutButton.setObjectName(u"closeAboutButton")
54 | self.closeAboutButton.setGeometry(QRect(150, 340, 87, 29))
55 | self.label_3 = QLabel(self.frame)
56 | self.label_3.setObjectName(u"label_3")
57 | self.label_3.setGeometry(QRect(120, 40, 151, 141))
58 | self.label_3.setPixmap(QPixmap(u"PKEIconV001.png"))
59 | self.label_4 = QLabel(self.frame)
60 | self.label_4.setObjectName(u"label_4")
61 | self.label_4.setGeometry(QRect(10, 180, 361, 31))
62 | self.label_4.setFrameShape(QFrame.Shape.StyledPanel)
63 | self.label_4.setFrameShadow(QFrame.Shadow.Raised)
64 | self.label_4.setTextFormat(Qt.TextFormat.RichText)
65 | self.label_4.setAlignment(Qt.AlignmentFlag.AlignLeading|Qt.AlignmentFlag.AlignLeft|Qt.AlignmentFlag.AlignTop)
66 | self.label_4.setWordWrap(True)
67 | self.label_4.setTextInteractionFlags(Qt.TextInteractionFlag.NoTextInteraction)
68 | self.versionlabel = QLabel(self.frame)
69 | self.versionlabel.setObjectName(u"versionlabel")
70 | self.versionlabel.setGeometry(QRect(10, 219, 361, 31))
71 | self.versionlabel.setFrameShape(QFrame.Shape.StyledPanel)
72 | self.versionlabel.setFrameShadow(QFrame.Shadow.Raised)
73 | self.versionlabel.setTextFormat(Qt.TextFormat.RichText)
74 | self.versionlabel.setAlignment(Qt.AlignmentFlag.AlignLeading|Qt.AlignmentFlag.AlignLeft|Qt.AlignmentFlag.AlignTop)
75 | self.versionlabel.setWordWrap(True)
76 | self.versionlabel.setTextInteractionFlags(Qt.TextInteractionFlag.NoTextInteraction)
77 |
78 | self.retranslateUi(About)
79 | self.closeAboutButton.clicked.connect(About.aboutClose)
80 |
81 | QMetaObject.connectSlotsByName(About)
82 | # setupUi
83 |
84 | def retranslateUi(self, About):
85 | About.setWindowTitle(QCoreApplication.translate("About", u"About Polkit Explorer", None))
86 | self.label.setText(QCoreApplication.translate("About", u"Polkit Explorer
", None))
87 | self.label_2.setText(QCoreApplication.translate("About", u"Allows a user to load polkit-1 .policy files and explore their contents in a human-readable format.
", None))
88 | self.closeAboutButton.setText(QCoreApplication.translate("About", u"Close", None))
89 | self.label_3.setText("")
90 | self.label_4.setText(QCoreApplication.translate("About", u"Copyright (c) Kevin Cave 2013-onwards
", None))
91 | self.versionlabel.setText(QCoreApplication.translate("About", u"Version :
", None))
92 | # retranslateUi
93 |
94 |
--------------------------------------------------------------------------------
/About.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | About
4 |
5 |
6 | Qt::WindowModality::NonModal
7 |
8 |
9 |
10 | 0
11 | 0
12 | 400
13 | 386
14 |
15 |
16 |
17 | About Polkit Explorer
18 |
19 |
20 |
21 |
22 | 9
23 | 9
24 | 381
25 | 371
26 |
27 |
28 |
29 | QFrame::Shape::StyledPanel
30 |
31 |
32 | QFrame::Shadow::Raised
33 |
34 |
35 | 1
36 |
37 |
38 |
39 |
40 | 40
41 | 0
42 | 281
43 | 41
44 |
45 |
46 |
47 |
48 | 12
49 | true
50 |
51 |
52 |
53 | QFrame::Shape::NoFrame
54 |
55 |
56 | 3
57 |
58 |
59 | <html><head/><body><p align="center"><span style=" font-size:14pt;">Polkit Explorer</span></p></body></html>
60 |
61 |
62 | Qt::AlignmentFlag::AlignCenter
63 |
64 |
65 |
66 |
67 |
68 | 10
69 | 260
70 | 361
71 | 71
72 |
73 |
74 |
75 | QFrame::Shape::StyledPanel
76 |
77 |
78 | QFrame::Shadow::Raised
79 |
80 |
81 | <html><head/><body><p><span style=" font-size:11pt; font-weight:600;">Allows a user to load polkit-1 .policy files and explore their contents in a human-readable format.</span></p></body></html>
82 |
83 |
84 | Qt::TextFormat::RichText
85 |
86 |
87 | Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop
88 |
89 |
90 | true
91 |
92 |
93 | Qt::TextInteractionFlag::NoTextInteraction
94 |
95 |
96 |
97 |
98 |
99 | 150
100 | 340
101 | 87
102 | 29
103 |
104 |
105 |
106 | Close
107 |
108 |
109 |
110 |
111 |
112 | 120
113 | 40
114 | 151
115 | 141
116 |
117 |
118 |
119 |
120 |
121 |
122 | PKEIconV001.png
123 |
124 |
125 |
126 |
127 |
128 | 10
129 | 180
130 | 361
131 | 31
132 |
133 |
134 |
135 | QFrame::Shape::StyledPanel
136 |
137 |
138 | QFrame::Shadow::Raised
139 |
140 |
141 | <html><head/><body><p><span style=" font-size:11pt; font-weight:700;">Copyright (c) Kevin Cave 2013-onwards</span></p></body></html>
142 |
143 |
144 | Qt::TextFormat::RichText
145 |
146 |
147 | Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop
148 |
149 |
150 | true
151 |
152 |
153 | Qt::TextInteractionFlag::NoTextInteraction
154 |
155 |
156 |
157 |
158 |
159 | 10
160 | 219
161 | 361
162 | 31
163 |
164 |
165 |
166 | QFrame::Shape::StyledPanel
167 |
168 |
169 | QFrame::Shadow::Raised
170 |
171 |
172 | <html><head/><body><p><span style=" font-size:11pt; font-weight:700;">Version :</span></p></body></html>
173 |
174 |
175 | Qt::TextFormat::RichText
176 |
177 |
178 | Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop
179 |
180 |
181 | true
182 |
183 |
184 | Qt::TextInteractionFlag::NoTextInteraction
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 | closeAboutButton
193 | clicked()
194 | About
195 | aboutClose()
196 |
197 |
198 | 204
199 | 358
200 |
201 |
202 | 260
203 | 296
204 |
205 |
206 |
207 |
208 |
209 | aboutClose()
210 |
211 |
212 |
--------------------------------------------------------------------------------
/polkitex.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | # Polkit Explorer
4 | # View/Explore all entries within a Linux Polkit XML file
5 | #
6 | # Original release date : 20130324 (yyyymmdd)
7 | #
8 | # Copyright (C) 2013-2024, Kevin Cave
9 | #
10 | # ISC License (ISC)
11 | #
12 | # Permission to use, copy, modify, and/or distribute this software for any purpose with
13 | # or without fee is hereby granted, provided that the above copyright notice and this
14 | # permission notice appear in all copies.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO
17 | # THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
18 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
19 | # DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
20 | # AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 | # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 | #
23 |
24 | from PySide6 import QtCore, QtWidgets
25 | from Ui_polkitex import Ui_PolkitExplorer
26 | from Ui_About import Ui_About
27 | from Ui_Glossary import Ui_Glossary
28 | from lxml import etree
29 | from importlib import reload
30 | import sys
31 | reload(sys)
32 |
33 | VERSION = 1.1
34 |
35 |
36 | class PolkitExplorer(QtWidgets.QMainWindow, Ui_PolkitExplorer):
37 | def __init__(self, parent=None):
38 | super(PolkitExplorer, self).__init__(parent)
39 | self.setupUi(self)
40 |
41 | @QtCore.Slot()
42 | # User wants to open a file...
43 | def fileOpen(self):
44 | self.open_action_file_dialog()
45 |
46 | # User wants to quit...
47 | def fileQuit(self):
48 | app.quit()
49 |
50 | # Event fires when comboBox changes (scrollwheel or click'n'select)
51 | def actionComboBoxChanged(self):
52 | self.actionID = str(self.actionComboBox.currentText())
53 | self.parseAction(self.actionID)
54 |
55 | def fileAbout(self):
56 | self.aboutDialog = aboutPolkitExplorer()
57 | self.aboutDialog.versionlabel.setText("Version : " + str(VERSION))
58 | self.aboutDialog.exec()
59 |
60 | def helpGlossary(self):
61 | self.glossaryDialog = glossaryPolkitExplorer()
62 | self.glossaryDialog.exec()
63 |
64 | # Display file open dialog at the correct dir and with a filename filter for the policy files
65 | # then fill the Actions Combobox
66 | def open_action_file_dialog(self):
67 | fname, _filter = QtWidgets.QFileDialog.getOpenFileName(self, 'Open Polkit file...', '/usr/share/polkit-1/actions/', '*.policy')
68 | if fname != "":
69 | self.parsePolKitFile(str(fname))
70 |
71 | # fill Actions ComboBox with list of all actions for specified Policy File.
72 | def parsePolKitFile(self, fname):
73 |
74 | # Display the filename of the policy kit file
75 | self.policyKitFileName.setText(fname)
76 |
77 | #Read the selected file and create the lxml tree object...
78 | parser = etree.XMLParser(encoding='utf-8')
79 | self.tree = etree.parse(fname, parser)
80 | self.root = self.tree.getroot()
81 |
82 | self.actionComboBox.clear()
83 | self.actionsCount = 0
84 |
85 | # Fill the Actions combo box list with all actions from the loaded polkit file...
86 | for actionslist in self.root.iter('action'):
87 | actname = actionslist.get('id')
88 | self.actionComboBox.addItem(str(actname))
89 | self.actionsCount = self.actionsCount + 1
90 | self.actionsCounterDisplay.display(self.actionsCount)
91 |
92 | def parseAction(self, actionID):
93 | description = None
94 | for actionslist in self.root.iter('action'):
95 | policy = actionslist.get('id')
96 | if policy == actionID:
97 | # Get the default permissions for the selected Action...
98 | for action in self.root.xpath('.//action[@id = $policy]', policy=actionID):
99 | self.anySet = 0
100 | self.inSet = 0
101 | self.actSet = 0
102 | for defaults in action.findall("./defaults/"):
103 | self.fillDefaultsTable(defaults.tag, defaults.text)
104 | # Get the desired Description of the Action...
105 | # Note: It's a complete PITA... some .policy XML files just have Descriptions with
106 | # no xml:lang attributes, and some have, and one file has a Description element
107 | # tag of "_description"! Yep, a complete PITA, all right...
108 | for d in self.root.xpath('.//action[@id = $policy]/description[@xml:lang = $lang]', policy=policy, lang="en_GB"):
109 | description = d.text
110 | if description is not None:
111 | self.polkitActionDescription.setText(description)
112 | else:
113 | # Okay so we didn't find a Description with an xml:lang attribute, so try to find one
114 | # which has a "description" tag with no attributes...
115 | for d in self.root.xpath('.//action[@id = $policy]/*[local-name()="description" or local-name()="_description"]', policy=actionID):
116 | if d.attrib == "":
117 | description = d.text
118 | if description is not None:
119 | # Found one!
120 | self.polkitActionDescription.setText(description)
121 | else:
122 | # Booooo!
123 | self.polkitActionDescription.setText("No description found - how helpfull!")
124 |
125 | def fillDefaultsTable(self, defaultTag, defaultText):
126 | if defaultTag == "allow_any":
127 | self.currentAllowAnyLabel.setText(defaultText)
128 | self.anySet = 1
129 | elif defaultTag == "allow_inactive":
130 | self.currentAllowInactiveLabel.setText(defaultText)
131 | self.inSet = 1
132 | elif defaultTag == "allow_active":
133 | self.currentAllowActiveLabel.setText(defaultText)
134 | self.actSet = 1
135 | if self.anySet == 0:
136 | self.currentAllowAnyLabel.setText("")
137 | if self.inSet == 0:
138 | self.currentAllowInactiveLabel.setText("")
139 | if self.actSet == 0:
140 | self.currentAllowActiveLabel.setText("")
141 |
142 | class aboutPolkitExplorer(QtWidgets.QDialog, Ui_About):
143 | def __init__(self, parent=None):
144 | QtWidgets.QDialog.__init__(self, parent)
145 | self.aboutDialog = Ui_About()
146 | self.setupUi(self)
147 |
148 | def aboutClose(self):
149 | self.close()
150 |
151 |
152 | class glossaryPolkitExplorer(QtWidgets.QDialog, Ui_Glossary):
153 | def __init__(self, parent=None):
154 | QtWidgets.QDialog.__init__(self,parent)
155 | self.glossaryDialog = Ui_Glossary()
156 | self.setupUi(self)
157 |
158 | def closeGlossary(self):
159 | self.close()
160 |
161 |
162 | if __name__ == '__main__':
163 | import sys
164 | app = QtWidgets.QApplication(sys.argv)
165 | window = PolkitExplorer()
166 | window.show()
167 | sys.exit(app.exec())
168 |
--------------------------------------------------------------------------------
/Ui_polkitex.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | ################################################################################
4 | ## Form generated from reading UI file 'polkitex.ui'
5 | ##
6 | ## Created by: Qt User Interface Compiler version 6.8.0
7 | ##
8 | ## WARNING! All changes made in this file will be lost when recompiling UI file!
9 | ################################################################################
10 |
11 | from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
12 | QMetaObject, QObject, QPoint, QRect,
13 | QSize, QTime, QUrl, Qt)
14 | from PySide6.QtGui import (QAction, QBrush, QColor, QConicalGradient,
15 | QCursor, QFont, QFontDatabase, QGradient,
16 | QIcon, QImage, QKeySequence, QLinearGradient,
17 | QPainter, QPalette, QPixmap, QRadialGradient,
18 | QTransform)
19 | from PySide6.QtWidgets import (QApplication, QComboBox, QFrame, QLCDNumber,
20 | QLabel, QMainWindow, QMenu, QMenuBar,
21 | QSizePolicy, QStatusBar, QTabWidget, QWidget)
22 |
23 | class Ui_PolkitExplorer(object):
24 | def setupUi(self, PolkitExplorer):
25 | if not PolkitExplorer.objectName():
26 | PolkitExplorer.setObjectName(u"PolkitExplorer")
27 | PolkitExplorer.resize(910, 530)
28 | sizePolicy = QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
29 | sizePolicy.setHorizontalStretch(0)
30 | sizePolicy.setVerticalStretch(0)
31 | sizePolicy.setHeightForWidth(PolkitExplorer.sizePolicy().hasHeightForWidth())
32 | PolkitExplorer.setSizePolicy(sizePolicy)
33 | PolkitExplorer.setMinimumSize(QSize(910, 530))
34 | PolkitExplorer.setMaximumSize(QSize(910, 530))
35 | PolkitExplorer.setTabShape(QTabWidget.TabShape.Rounded)
36 | self.action_open = QAction(PolkitExplorer)
37 | self.action_open.setObjectName(u"action_open")
38 | font = QFont()
39 | font.setPointSize(12)
40 | font.setBold(True)
41 | self.action_open.setFont(font)
42 | self.action_about = QAction(PolkitExplorer)
43 | self.action_about.setObjectName(u"action_about")
44 | self.action_about.setFont(font)
45 | self.action_quit = QAction(PolkitExplorer)
46 | self.action_quit.setObjectName(u"action_quit")
47 | self.action_show_glossary = QAction(PolkitExplorer)
48 | self.action_show_glossary.setObjectName(u"action_show_glossary")
49 | self.centralwidget = QWidget(PolkitExplorer)
50 | self.centralwidget.setObjectName(u"centralwidget")
51 | self.polkitActionDescription = QLabel(self.centralwidget)
52 | self.polkitActionDescription.setObjectName(u"polkitActionDescription")
53 | self.polkitActionDescription.setGeometry(QRect(130, 290, 761, 31))
54 | font1 = QFont()
55 | font1.setPointSize(11)
56 | font1.setBold(True)
57 | self.polkitActionDescription.setFont(font1)
58 | self.polkitActionDescription.setAutoFillBackground(True)
59 | self.polkitActionDescription.setFrameShape(QFrame.Shape.StyledPanel)
60 | self.polkitActionDescription.setTextFormat(Qt.TextFormat.PlainText)
61 | self.polkitActionDescription.setScaledContents(True)
62 | self.polkitActionDescription.setTextInteractionFlags(Qt.TextInteractionFlag.TextSelectableByKeyboard|Qt.TextInteractionFlag.TextSelectableByMouse)
63 | self.frame = QFrame(self.centralwidget)
64 | self.frame.setObjectName(u"frame")
65 | self.frame.setGeometry(QRect(160, 350, 621, 101))
66 | self.frame.setFrameShape(QFrame.Shape.StyledPanel)
67 | self.frame.setFrameShadow(QFrame.Shadow.Sunken)
68 | self.currentallowanylabel = QLabel(self.frame)
69 | self.currentallowanylabel.setObjectName(u"currentallowanylabel")
70 | self.currentallowanylabel.setGeometry(QRect(30, 10, 131, 31))
71 | self.currentallowanylabel.setFont(font)
72 | self.currentallowanylabel.setFrameShape(QFrame.Shape.StyledPanel)
73 | self.currentallowanylabel.setFrameShadow(QFrame.Shadow.Raised)
74 | self.currentallowanylabel.setAlignment(Qt.AlignmentFlag.AlignCenter)
75 | self.currentallowanylabel_2 = QLabel(self.frame)
76 | self.currentallowanylabel_2.setObjectName(u"currentallowanylabel_2")
77 | self.currentallowanylabel_2.setGeometry(QRect(220, 10, 161, 31))
78 | self.currentallowanylabel_2.setFont(font)
79 | self.currentallowanylabel_2.setFrameShape(QFrame.Shape.StyledPanel)
80 | self.currentallowanylabel_2.setFrameShadow(QFrame.Shadow.Raised)
81 | self.currentallowanylabel_2.setAlignment(Qt.AlignmentFlag.AlignCenter)
82 | self.currentallowanylabel_3 = QLabel(self.frame)
83 | self.currentallowanylabel_3.setObjectName(u"currentallowanylabel_3")
84 | self.currentallowanylabel_3.setGeometry(QRect(440, 10, 151, 31))
85 | self.currentallowanylabel_3.setFont(font)
86 | self.currentallowanylabel_3.setFrameShape(QFrame.Shape.StyledPanel)
87 | self.currentallowanylabel_3.setFrameShadow(QFrame.Shadow.Raised)
88 | self.currentallowanylabel_3.setAlignment(Qt.AlignmentFlag.AlignCenter)
89 | self.currentAllowAnyLabel = QLabel(self.frame)
90 | self.currentAllowAnyLabel.setObjectName(u"currentAllowAnyLabel")
91 | self.currentAllowAnyLabel.setGeometry(QRect(20, 50, 151, 20))
92 | self.currentAllowAnyLabel.setFont(font)
93 | self.currentAllowAnyLabel.setAlignment(Qt.AlignmentFlag.AlignCenter)
94 | self.currentAllowInactiveLabel = QLabel(self.frame)
95 | self.currentAllowInactiveLabel.setObjectName(u"currentAllowInactiveLabel")
96 | self.currentAllowInactiveLabel.setGeometry(QRect(210, 50, 181, 20))
97 | self.currentAllowInactiveLabel.setFont(font)
98 | self.currentAllowInactiveLabel.setAlignment(Qt.AlignmentFlag.AlignCenter)
99 | self.currentAllowActiveLabel = QLabel(self.frame)
100 | self.currentAllowActiveLabel.setObjectName(u"currentAllowActiveLabel")
101 | self.currentAllowActiveLabel.setGeometry(QRect(420, 50, 191, 20))
102 | self.currentAllowActiveLabel.setFont(font)
103 | self.currentAllowActiveLabel.setAlignment(Qt.AlignmentFlag.AlignCenter)
104 | self.currentAllowAnyLabel.raise_()
105 | self.currentAllowInactiveLabel.raise_()
106 | self.currentAllowActiveLabel.raise_()
107 | self.currentallowanylabel.raise_()
108 | self.currentallowanylabel_2.raise_()
109 | self.currentallowanylabel_3.raise_()
110 | self.label_3 = QLabel(self.centralwidget)
111 | self.label_3.setObjectName(u"label_3")
112 | self.label_3.setGeometry(QRect(20, 290, 101, 31))
113 | self.label_3.setFont(font1)
114 | self.label = QLabel(self.centralwidget)
115 | self.label.setObjectName(u"label")
116 | self.label.setGeometry(QRect(10, 10, 891, 61))
117 | font2 = QFont()
118 | font2.setFamilies([u"DejaVu Sans"])
119 | font2.setPointSize(12)
120 | font2.setBold(True)
121 | self.label.setFont(font2)
122 | self.label.setFrameShape(QFrame.Shape.StyledPanel)
123 | self.label.setFrameShadow(QFrame.Shadow.Raised)
124 | self.label.setAlignment(Qt.AlignmentFlag.AlignLeading|Qt.AlignmentFlag.AlignLeft|Qt.AlignmentFlag.AlignVCenter)
125 | self.policyKitFileName = QLabel(self.centralwidget)
126 | self.policyKitFileName.setObjectName(u"policyKitFileName")
127 | self.policyKitFileName.setGeometry(QRect(160, 20, 721, 41))
128 | self.policyKitFileName.setFont(font)
129 | self.policyKitFileName.setFrameShape(QFrame.Shape.StyledPanel)
130 | self.policyKitFileName.setFrameShadow(QFrame.Shadow.Sunken)
131 | self.policyKitFileName.setLineWidth(2)
132 | self.policyKitFileName.setAlignment(Qt.AlignmentFlag.AlignLeading|Qt.AlignmentFlag.AlignLeft|Qt.AlignmentFlag.AlignVCenter)
133 | self.policyKitFileName.setTextInteractionFlags(Qt.TextInteractionFlag.LinksAccessibleByMouse|Qt.TextInteractionFlag.TextSelectableByMouse)
134 | self.polkitActionNameLabel = QLabel(self.centralwidget)
135 | self.polkitActionNameLabel.setObjectName(u"polkitActionNameLabel")
136 | self.polkitActionNameLabel.setEnabled(True)
137 | self.polkitActionNameLabel.setGeometry(QRect(10, 230, 891, 101))
138 | font3 = QFont()
139 | font3.setPointSize(14)
140 | font3.setBold(True)
141 | self.polkitActionNameLabel.setFont(font3)
142 | self.polkitActionNameLabel.setFrameShape(QFrame.Shape.StyledPanel)
143 | self.polkitActionNameLabel.setFrameShadow(QFrame.Shadow.Raised)
144 | self.polkitActionNameLabel.setAlignment(Qt.AlignmentFlag.AlignLeading|Qt.AlignmentFlag.AlignLeft|Qt.AlignmentFlag.AlignTop)
145 | self.actionComboBox = QComboBox(self.centralwidget)
146 | self.actionComboBox.setObjectName(u"actionComboBox")
147 | self.actionComboBox.setGeometry(QRect(130, 240, 761, 29))
148 | self.actionComboBox.setFont(font)
149 | self.polkitActionNameLabel_2 = QLabel(self.centralwidget)
150 | self.polkitActionNameLabel_2.setObjectName(u"polkitActionNameLabel_2")
151 | self.polkitActionNameLabel_2.setEnabled(True)
152 | self.polkitActionNameLabel_2.setGeometry(QRect(10, 340, 891, 121))
153 | self.polkitActionNameLabel_2.setFont(font3)
154 | self.polkitActionNameLabel_2.setFrameShape(QFrame.Shape.StyledPanel)
155 | self.polkitActionNameLabel_2.setFrameShadow(QFrame.Shadow.Raised)
156 | self.polkitActionNameLabel_2.setAlignment(Qt.AlignmentFlag.AlignLeading|Qt.AlignmentFlag.AlignLeft|Qt.AlignmentFlag.AlignTop)
157 | self.polkitActionNameLabel_3 = QLabel(self.centralwidget)
158 | self.polkitActionNameLabel_3.setObjectName(u"polkitActionNameLabel_3")
159 | self.polkitActionNameLabel_3.setEnabled(True)
160 | self.polkitActionNameLabel_3.setGeometry(QRect(10, 80, 891, 141))
161 | self.polkitActionNameLabel_3.setFont(font3)
162 | self.polkitActionNameLabel_3.setFrameShape(QFrame.Shape.StyledPanel)
163 | self.polkitActionNameLabel_3.setFrameShadow(QFrame.Shadow.Raised)
164 | self.polkitActionNameLabel_3.setAlignment(Qt.AlignmentFlag.AlignLeading|Qt.AlignmentFlag.AlignLeft|Qt.AlignmentFlag.AlignTop)
165 | self.actionsCounterDisplay = QLCDNumber(self.centralwidget)
166 | self.actionsCounterDisplay.setObjectName(u"actionsCounterDisplay")
167 | self.actionsCounterDisplay.setGeometry(QRect(20, 150, 131, 61))
168 | self.actionsCounterDisplay.setFrameShape(QFrame.Shape.StyledPanel)
169 | self.actionsCounterDisplay.setFrameShadow(QFrame.Shadow.Sunken)
170 | self.label_2 = QLabel(self.centralwidget)
171 | self.label_2.setObjectName(u"label_2")
172 | self.label_2.setGeometry(QRect(20, 120, 131, 21))
173 | self.label_2.setFont(font)
174 | self.label_2.setFrameShape(QFrame.Shape.StyledPanel)
175 | self.label_2.setFrameShadow(QFrame.Shadow.Raised)
176 | self.label_2.setAlignment(Qt.AlignmentFlag.AlignCenter)
177 | PolkitExplorer.setCentralWidget(self.centralwidget)
178 | self.polkitActionNameLabel_2.raise_()
179 | self.polkitActionNameLabel.raise_()
180 | self.frame.raise_()
181 | self.label_3.raise_()
182 | self.label.raise_()
183 | self.polkitActionNameLabel_3.raise_()
184 | self.label_2.raise_()
185 | self.policyKitFileName.raise_()
186 | self.actionsCounterDisplay.raise_()
187 | self.actionComboBox.raise_()
188 | self.polkitActionDescription.raise_()
189 | self.menubar = QMenuBar(PolkitExplorer)
190 | self.menubar.setObjectName(u"menubar")
191 | self.menubar.setGeometry(QRect(0, 0, 910, 27))
192 | self.menubar.setFont(font)
193 | self.menuFile = QMenu(self.menubar)
194 | self.menuFile.setObjectName(u"menuFile")
195 | self.menuFile.setFont(font)
196 | self.menuHelp = QMenu(self.menubar)
197 | self.menuHelp.setObjectName(u"menuHelp")
198 | self.menuHelp.setFont(font)
199 | PolkitExplorer.setMenuBar(self.menubar)
200 | self.statusbar = QStatusBar(PolkitExplorer)
201 | self.statusbar.setObjectName(u"statusbar")
202 | PolkitExplorer.setStatusBar(self.statusbar)
203 |
204 | self.menubar.addAction(self.menuFile.menuAction())
205 | self.menubar.addAction(self.menuHelp.menuAction())
206 | self.menuFile.addAction(self.action_open)
207 | self.menuFile.addSeparator()
208 | self.menuFile.addAction(self.action_quit)
209 | self.menuHelp.addSeparator()
210 | self.menuHelp.addAction(self.action_about)
211 | self.menuHelp.addSeparator()
212 | self.menuHelp.addAction(self.action_show_glossary)
213 |
214 | self.retranslateUi(PolkitExplorer)
215 | self.actionComboBox.currentIndexChanged.connect(PolkitExplorer.actionComboBoxChanged)
216 | self.action_open.triggered.connect(PolkitExplorer.fileOpen)
217 | self.action_quit.triggered.connect(PolkitExplorer.fileQuit)
218 | self.action_about.triggered.connect(PolkitExplorer.fileAbout)
219 | self.action_show_glossary.triggered.connect(PolkitExplorer.helpGlossary)
220 |
221 | QMetaObject.connectSlotsByName(PolkitExplorer)
222 | # setupUi
223 |
224 | def retranslateUi(self, PolkitExplorer):
225 | PolkitExplorer.setWindowTitle(QCoreApplication.translate("PolkitExplorer", u"Polkit Explorer", None))
226 | self.action_open.setText(QCoreApplication.translate("PolkitExplorer", u"&Open", None))
227 | self.action_about.setText(QCoreApplication.translate("PolkitExplorer", u"&About", None))
228 | self.action_quit.setText(QCoreApplication.translate("PolkitExplorer", u"&Quit", None))
229 | self.action_show_glossary.setText(QCoreApplication.translate("PolkitExplorer", u"&Show Glossary", None))
230 | #if QT_CONFIG(tooltip)
231 | self.polkitActionDescription.setToolTip(QCoreApplication.translate("PolkitExplorer", u"The Description of the Action as entered in the Policy file loaded. If no description is found this will tell you that fact.
", None))
232 | #endif // QT_CONFIG(tooltip)
233 | self.polkitActionDescription.setText("")
234 | #if QT_CONFIG(tooltip)
235 | self.currentallowanylabel.setToolTip(QCoreApplication.translate("PolkitExplorer", u"If set to "yes" will give any user permission to perform the action as described in the Description above.
", None))
236 | #endif // QT_CONFIG(tooltip)
237 | self.currentallowanylabel.setText(QCoreApplication.translate("PolkitExplorer", u"Allow Any", None))
238 | #if QT_CONFIG(tooltip)
239 | self.currentallowanylabel_2.setToolTip(QCoreApplication.translate("PolkitExplorer", u""Inactive" users are ones who are not directly logged into the system's console. This includes anyone who is logged in remotely, whether it be via ssh, telnet, or even RDP.
", None))
240 | #endif // QT_CONFIG(tooltip)
241 | self.currentallowanylabel_2.setText(QCoreApplication.translate("PolkitExplorer", u"Allow Inactive", None))
242 | #if QT_CONFIG(tooltip)
243 | self.currentallowanylabel_3.setToolTip(QCoreApplication.translate("PolkitExplorer", u""Active" users are ones who are directly logged into a system's console, via a locally connected terminal. Users directly logged into a GUI at the system console, for example.
", None))
244 | #endif // QT_CONFIG(tooltip)
245 | self.currentallowanylabel_3.setText(QCoreApplication.translate("PolkitExplorer", u"Allow Active", None))
246 | self.currentAllowAnyLabel.setText("")
247 | self.currentAllowInactiveLabel.setText("")
248 | self.currentAllowActiveLabel.setText("")
249 | self.label_3.setText(QCoreApplication.translate("PolkitExplorer", u"Description :", None))
250 | self.label.setText(QCoreApplication.translate("PolkitExplorer", u"Policy Filename", None))
251 | #if QT_CONFIG(tooltip)
252 | self.policyKitFileName.setToolTip(QCoreApplication.translate("PolkitExplorer", u"The full pathname of the currently opened Polkit policy file.
", None))
253 | #endif // QT_CONFIG(tooltip)
254 | self.policyKitFileName.setText(QCoreApplication.translate("PolkitExplorer", u"Please open a policy file...", None))
255 | self.polkitActionNameLabel.setText(QCoreApplication.translate("PolkitExplorer", u"Action", None))
256 | #if QT_CONFIG(tooltip)
257 | self.actionComboBox.setToolTip(QCoreApplication.translate("PolkitExplorer", u"Drop-down list of all the actions within the policy file. Clicking on this will display the drop-down list, or you can use your scrollwheel to browse through them, too.
", None))
258 | #endif // QT_CONFIG(tooltip)
259 | self.polkitActionNameLabel_2.setText(QCoreApplication.translate("PolkitExplorer", u"Policy", None))
260 | self.polkitActionNameLabel_3.setText(QCoreApplication.translate("PolkitExplorer", u"Info", None))
261 | #if QT_CONFIG(tooltip)
262 | self.actionsCounterDisplay.setToolTip(QCoreApplication.translate("PolkitExplorer", u"Displays the number of Actions within a Polkit policy file.
", None))
263 | #endif // QT_CONFIG(tooltip)
264 | self.label_2.setText(QCoreApplication.translate("PolkitExplorer", u"# Actions", None))
265 | self.menuFile.setTitle(QCoreApplication.translate("PolkitExplorer", u"&File", None))
266 | self.menuHelp.setTitle(QCoreApplication.translate("PolkitExplorer", u"&Help", None))
267 | # retranslateUi
268 |
269 |
--------------------------------------------------------------------------------
/polkitex.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | Kevin Cave
4 | PolkitExplorer
5 |
6 |
7 |
8 | 0
9 | 0
10 | 910
11 | 530
12 |
13 |
14 |
15 |
16 | 0
17 | 0
18 |
19 |
20 |
21 |
22 | 910
23 | 530
24 |
25 |
26 |
27 |
28 | 910
29 | 530
30 |
31 |
32 |
33 | Polkit Explorer
34 |
35 |
36 | QTabWidget::TabShape::Rounded
37 |
38 |
39 |
40 |
41 |
42 | 130
43 | 290
44 | 761
45 | 31
46 |
47 |
48 |
49 |
50 | 11
51 | true
52 |
53 |
54 |
55 | <html><head/><body><p>The Description of the Action as entered in the Policy file loaded. If no description is found this will tell you that fact.</p></body></html>
56 |
57 |
58 | true
59 |
60 |
61 | QFrame::Shape::StyledPanel
62 |
63 |
64 |
65 |
66 |
67 | Qt::TextFormat::PlainText
68 |
69 |
70 | true
71 |
72 |
73 | Qt::TextInteractionFlag::TextSelectableByKeyboard|Qt::TextInteractionFlag::TextSelectableByMouse
74 |
75 |
76 |
77 |
78 |
79 | 160
80 | 350
81 | 621
82 | 101
83 |
84 |
85 |
86 | QFrame::Shape::StyledPanel
87 |
88 |
89 | QFrame::Shadow::Sunken
90 |
91 |
92 |
93 |
94 | 30
95 | 10
96 | 131
97 | 31
98 |
99 |
100 |
101 |
102 | 12
103 | true
104 |
105 |
106 |
107 | <html><head/><body><p>If set to "yes" will give any user permission to perform the action as described in the Description above. </p></body></html>
108 |
109 |
110 | QFrame::Shape::StyledPanel
111 |
112 |
113 | QFrame::Shadow::Raised
114 |
115 |
116 | Allow Any
117 |
118 |
119 | Qt::AlignmentFlag::AlignCenter
120 |
121 |
122 |
123 |
124 |
125 | 220
126 | 10
127 | 161
128 | 31
129 |
130 |
131 |
132 |
133 | 12
134 | true
135 |
136 |
137 |
138 | <html><head/><body><p>"Inactive" users are ones who are not directly logged into the system's console. This includes anyone who is logged in remotely, whether it be via ssh, telnet, or even RDP.</p></body></html>
139 |
140 |
141 | QFrame::Shape::StyledPanel
142 |
143 |
144 | QFrame::Shadow::Raised
145 |
146 |
147 | Allow Inactive
148 |
149 |
150 | Qt::AlignmentFlag::AlignCenter
151 |
152 |
153 |
154 |
155 |
156 | 440
157 | 10
158 | 151
159 | 31
160 |
161 |
162 |
163 |
164 | 12
165 | true
166 |
167 |
168 |
169 | <html><head/><body><p>"Active" users are ones who are directly logged into a system's console, via a locally connected terminal. Users directly logged into a GUI at the system console, for example.</p></body></html>
170 |
171 |
172 | QFrame::Shape::StyledPanel
173 |
174 |
175 | QFrame::Shadow::Raised
176 |
177 |
178 | Allow Active
179 |
180 |
181 | Qt::AlignmentFlag::AlignCenter
182 |
183 |
184 |
185 |
186 |
187 | 20
188 | 50
189 | 151
190 | 20
191 |
192 |
193 |
194 |
195 | 12
196 | true
197 |
198 |
199 |
200 |
201 |
202 |
203 | Qt::AlignmentFlag::AlignCenter
204 |
205 |
206 |
207 |
208 |
209 | 210
210 | 50
211 | 181
212 | 20
213 |
214 |
215 |
216 |
217 | 12
218 | true
219 |
220 |
221 |
222 |
223 |
224 |
225 | Qt::AlignmentFlag::AlignCenter
226 |
227 |
228 |
229 |
230 |
231 | 420
232 | 50
233 | 191
234 | 20
235 |
236 |
237 |
238 |
239 | 12
240 | true
241 |
242 |
243 |
244 |
245 |
246 |
247 | Qt::AlignmentFlag::AlignCenter
248 |
249 |
250 | currentAllowAnyLabel
251 | currentAllowInactiveLabel
252 | currentAllowActiveLabel
253 | currentallowanylabel
254 | currentallowanylabel_2
255 | currentallowanylabel_3
256 |
257 |
258 |
259 |
260 | 20
261 | 290
262 | 101
263 | 31
264 |
265 |
266 |
267 |
268 | 11
269 | true
270 |
271 |
272 |
273 | Description :
274 |
275 |
276 |
277 |
278 |
279 | 10
280 | 10
281 | 891
282 | 61
283 |
284 |
285 |
286 |
287 | DejaVu Sans
288 | 12
289 | true
290 |
291 |
292 |
293 | QFrame::Shape::StyledPanel
294 |
295 |
296 | QFrame::Shadow::Raised
297 |
298 |
299 | Policy Filename
300 |
301 |
302 | Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter
303 |
304 |
305 |
306 |
307 |
308 | 160
309 | 20
310 | 721
311 | 41
312 |
313 |
314 |
315 |
316 | 12
317 | true
318 |
319 |
320 |
321 | <html><head/><body><p>The full pathname of the currently opened Polkit policy file.</p></body></html>
322 |
323 |
324 | QFrame::Shape::StyledPanel
325 |
326 |
327 | QFrame::Shadow::Sunken
328 |
329 |
330 | 2
331 |
332 |
333 | Please open a policy file...
334 |
335 |
336 | Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter
337 |
338 |
339 | Qt::TextInteractionFlag::LinksAccessibleByMouse|Qt::TextInteractionFlag::TextSelectableByMouse
340 |
341 |
342 |
343 |
344 | true
345 |
346 |
347 |
348 | 10
349 | 230
350 | 891
351 | 101
352 |
353 |
354 |
355 |
356 | 14
357 | true
358 |
359 |
360 |
361 | QFrame::Shape::StyledPanel
362 |
363 |
364 | QFrame::Shadow::Raised
365 |
366 |
367 | Action
368 |
369 |
370 | Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop
371 |
372 |
373 |
374 |
375 |
376 | 130
377 | 240
378 | 761
379 | 29
380 |
381 |
382 |
383 |
384 | 12
385 | true
386 |
387 |
388 |
389 | <html><head/><body><p><span style=" font-weight:600;">Drop-down list of all the actions within the policy file. Clicking on this will display the drop-down list, or you can use your scrollwheel to browse through them, too.</span></p></body></html>
390 |
391 |
392 |
393 |
394 | true
395 |
396 |
397 |
398 | 10
399 | 340
400 | 891
401 | 121
402 |
403 |
404 |
405 |
406 | 14
407 | true
408 |
409 |
410 |
411 | QFrame::Shape::StyledPanel
412 |
413 |
414 | QFrame::Shadow::Raised
415 |
416 |
417 | Policy
418 |
419 |
420 | Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop
421 |
422 |
423 |
424 |
425 | true
426 |
427 |
428 |
429 | 10
430 | 80
431 | 891
432 | 141
433 |
434 |
435 |
436 |
437 | 14
438 | true
439 |
440 |
441 |
442 | QFrame::Shape::StyledPanel
443 |
444 |
445 | QFrame::Shadow::Raised
446 |
447 |
448 | Info
449 |
450 |
451 | Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop
452 |
453 |
454 |
455 |
456 |
457 | 20
458 | 150
459 | 131
460 | 61
461 |
462 |
463 |
464 | <html><head/><body><p><span style=" font-size:12pt; font-weight:600;">Displays the number of Actions within a Polkit policy file.</span></p></body></html>
465 |
466 |
467 | QFrame::Shape::StyledPanel
468 |
469 |
470 | QFrame::Shadow::Sunken
471 |
472 |
473 |
474 |
475 |
476 | 20
477 | 120
478 | 131
479 | 21
480 |
481 |
482 |
483 |
484 | 12
485 | true
486 |
487 |
488 |
489 | QFrame::Shape::StyledPanel
490 |
491 |
492 | QFrame::Shadow::Raised
493 |
494 |
495 | # Actions
496 |
497 |
498 | Qt::AlignmentFlag::AlignCenter
499 |
500 |
501 | polkitActionNameLabel_2
502 | polkitActionNameLabel
503 | frame
504 | label_3
505 | label
506 | polkitActionNameLabel_3
507 | label_2
508 | policyKitFileName
509 | actionsCounterDisplay
510 | actionComboBox
511 | polkitActionDescription
512 |
513 |
560 |
561 |
562 |
563 | &Open
564 |
565 |
566 |
567 | 12
568 | true
569 |
570 |
571 |
572 |
573 |
574 | &About
575 |
576 |
577 |
578 | 12
579 | true
580 |
581 |
582 |
583 |
584 |
585 | &Quit
586 |
587 |
588 |
589 |
590 | &Show Glossary
591 |
592 |
593 |
594 |
595 |
596 |
597 | actionComboBox
598 | currentIndexChanged(int)
599 | PolkitExplorer
600 | actionComboBoxChanged()
601 |
602 |
603 | 333
604 | 273
605 |
606 |
607 | 794
608 | 201
609 |
610 |
611 |
612 |
613 | action_open
614 | triggered()
615 | PolkitExplorer
616 | fileOpen()
617 |
618 |
619 | -1
620 | -1
621 |
622 |
623 | 452
624 | 307
625 |
626 |
627 |
628 |
629 | action_quit
630 | triggered()
631 | PolkitExplorer
632 | fileQuit()
633 |
634 |
635 | -1
636 | -1
637 |
638 |
639 | 452
640 | 307
641 |
642 |
643 |
644 |
645 | action_about
646 | triggered()
647 | PolkitExplorer
648 | fileAbout()
649 |
650 |
651 | -1
652 | -1
653 |
654 |
655 | 454
656 | 298
657 |
658 |
659 |
660 |
661 | action_show_glossary
662 | triggered()
663 | PolkitExplorer
664 | helpGlossary()
665 |
666 |
667 | -1
668 | -1
669 |
670 |
671 | 454
672 | 264
673 |
674 |
675 |
676 |
677 |
678 | actionComboBoxChanged()
679 | fileOpen()
680 | fileQuit()
681 | fileAbout()
682 | helpGlossary()
683 |
684 |
685 |
--------------------------------------------------------------------------------