1 |
On Tue, 12 Aug 2014 18:33:21 -0500 |
2 |
Canek Peláez Valdés <caneko@×××××.com> wrote: |
3 |
|
4 |
> Assuming you want to disable the functionality for one user, this |
5 |
> disables both the functionality *AND* the buttons (they show up grayed |
6 |
> out): |
7 |
> |
8 |
> $ cat /etc/polkit-1/rules.d/10-no-restart-shutdown.rules |
9 |
> polkit.addRule(function(action, subject) { |
10 |
> if (subject.user == "myuser") { |
11 |
> if (action.id.match("org.freedesktop.login1.power-off") || |
12 |
> action.id.match("org.freedesktop.login1.reboot")) { |
13 |
> return polkit.Result.NO; |
14 |
> } |
15 |
> } |
16 |
> }); |
17 |
> |
18 |
> Of course, change "myuser" for the user you want to disable this. You |
19 |
> can also use groups (subject.isInGroup("group")), or use "suspend" or |
20 |
> "hibernate" instead of "reboot". |
21 |
> |
22 |
|
23 |
That worked. Thank you very much. Now I have disabled (greyed out) the |
24 |
buttons for certain users. That's what I have looked for. |
25 |
|
26 |
Bye |
27 |
Johannes |
28 |
-- |
29 |
|
30 |
------//-------------------------------------------------------------- |
31 |
// Johannes R. Geiss Mac mini server and |
32 |
\\ // OpenPandora user |
33 |
--\X/----------------------------------------------------------------- |