KAuthorized

KAuthorized Namespace Reference

Functions

KCONFIGCORE_EXPORT bool authorize (const QString &action)
 
KCONFIGCORE_EXPORT bool authorizeAction (const QString &action)
 
KCONFIGCORE_EXPORT bool authorizeControlModule (const QString &menuId)
 
KCONFIGCORE_EXPORT QStringList authorizeControlModules (const QStringList &menuIds)
 
KCONFIGCORE_EXPORT bool authorizeKAction (const QString &action)
 

Detailed Description

The functions in this namespace provide the core of the Kiosk action restriction system; the KIO and KXMLGui frameworks build on this.

The relevant settings are read from the application's KSharedConfig instance, so actions can be disabled on a per-application or global basis (by using the kdeglobals file).

Function Documentation

bool KAuthorized::authorize ( const QString action)

Returns whether the user is permitted to perform a certain action.

All settings are read from the "[KDE Action Restrictions]" group. For example, if kdeglobals contains

[KDE Action Restrictions][$i]
shell_access=false

then

KAuthorized::authorize("shell_access");

will return false.

This method is intended for actions that do not necessarily have a one-to-one correspondence with a menu or toolbar item (ie: a QAction in a KXMLGui application). "shell_access" is an example of such a "generic" action.

The convention for actions like "File->New" is to prepend the action name with "action/", for example "action/file_new". This is what authorizeAction() does.

Parameters
actionThe name of the action.
Returns
true if the action is authorized, false otherwise.
See also
authorizeAction()

Definition at line 190 of file kauthorized.cpp.

bool KAuthorized::authorizeAction ( const QString action)

Returns whether the user is permitted to perform a certain action.

This behaves like authorize(), except that "action/" is prepended to action. So if kdeglobals contains

[KDE Action Restrictions][$i]
action/file_new=false

then

will return false.

KXMLGui-based applications should not normally need to call this function, as KActionCollection will do it automatically.

Parameters
actionThe name of a QAction action.
Returns
true if the QAction is authorized, false otherwise.
Since
5.24
See also
authorize()

Definition at line 205 of file kauthorized.cpp.

bool KAuthorized::authorizeControlModule ( const QString menuId)

Returns whether the user is permitted to use a certain control module.

All settings are read from the "[KDE Control Module Restrictions]" group. For example, if kdeglobals contains

[KDE Control Module Restrictions][$i]
desktop-settings.desktop=false

then

KAuthorized::authorizeControlModule("desktop-settings.desktop");

will return false.

Parameters
menuIdThe desktop menu ID for the control module.
Returns
true if access to the module is authorized, false otherwise.
See also
authorizeControlModules()

Definition at line 225 of file kauthorized.cpp.

QStringList KAuthorized::authorizeControlModules ( const QStringList menuIds)

Determines which control modules from a list the user is permitted to use.

Parameters
menuIdsA list of desktop menu IDs for control modules.
Returns
The entries in menuIds for which authorizeControlModule() returns true.
See also
authorizeControlModule()

Definition at line 234 of file kauthorized.cpp.

bool KAuthorized::authorizeKAction ( const QString action)

Returns whether the user is permitted to perform a certain action.

This behaves like authorize(), except that "action/" is prepended to action. So if kdeglobals contains

[KDE Action Restrictions][$i]
action/file_new=false

then

will return false.

KXMLGui-based applications should not normally need to call this function, as KActionCollection will do it automatically.

Parameters
actionThe name of a KAction action.
Returns
true if the KAction is authorized, false otherwise.
See also
authorize()
Deprecated:
since 5.24, use authorizeAction() instead.

Definition at line 219 of file kauthorized.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun May 24 2020 23:05:29 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.