| | 1 | = Restrict Access to Applications = |
| | 2 | |
| | 3 | sometimes, applications are installed on the system, |
| | 4 | but not all users should not be able to start it. |
| | 5 | |
| | 6 | uninstalling not always possible, |
| | 7 | because some users may use it, or it is part of a larger RPM and the other applications from the RPM should stay on the system. |
| | 8 | |
| | 9 | different approaches: |
| | 10 | |
| | 11 | |
| | 12 | ====== TryExec ====== |
| | 13 | |
| | 14 | check, if the user is allowed, to execute the application: |
| | 15 | |
| | 16 | {{{ |
| | 17 | [Desktop Entry] |
| | 18 | Comment=Ganttproject |
| | 19 | Exec=/opt/ganttproject/ganttproject.sh |
| | 20 | TryExec=/opt/ganttproject/ganttproject.sh |
| | 21 | }}} |
| | 22 | |
| | 23 | If the command that is specified by TryExec is not executable by the user, |
| | 24 | the Desktop-Entries is not displayed in the Start-Menu. |
| | 25 | |
| | 26 | |
| | 27 | ====== hide application by modifying the .desktop file ====== |
| | 28 | |
| | 29 | show only, if VMware image exists (and is readable): |
| | 30 | |
| | 31 | vmware-winnt.desktop: |
| | 32 | {{{ |
| | 33 | [Desktop Entry] |
| | 34 | Comment=VMware mit Windows NT starten |
| | 35 | Exec=/usr/bin/sudo /usr/bin/sc_vmware.sh /local/vmware/vermka/Windows_NT.vmx |
| | 36 | Hidden[$e]=$(test -r /local/vmware/vermka/Windows_NT.vmx || echo "true") |
| | 37 | }}} |
| | 38 | |
| | 39 | ====== permissions ====== |
| | 40 | |
| | 41 | Set application permissions to not executable by normal user and desktop files to be not readable. |
| | 42 | Define this in a permissions file under {{{/etc/permissions.d/}}}. |
| | 43 | Filename must match a installed RPM name. |
| | 44 | |
| | 45 | Execute |
| | 46 | {{{/sbin/conf.d/SuSEconfig.permissions}}} |
| | 47 | |
| | 48 | which sets permissions accordanly. |
| | 49 | After package installation by YaST, SuSEconfig is called |
| | 50 | and sets permissions. |
| | 51 | Therefore application is still unaccessable after a package update. |
| | 52 | |
| | 53 | Example: |
| | 54 | /etc/permissions.d/k3b: |
| | 55 | {{{ |
| | 56 | /usr/bin/k3b root.media 750 |
| | 57 | /usr/share/applications/kde4/k3b.desktop root.media 640 |
| | 58 | }}} |
| | 59 | |
| | 60 | |