Plasma
#include <authorizationrule.h>
Public Types | |
enum | Persistence { Transient = 0, Persistent = 1 } |
enum | Policy { Deny = 0, Allow = 1, PinRequired = 2 } |
enum | Target { Default = 0, AllUsers = 1, AllServices = 2 } |
Signals | |
void | changed (Plasma::AuthorizationRule *) |
Public Member Functions | |
~AuthorizationRule () | |
Credentials | credentials () const |
QString | description () const |
Persistence | persistence () |
QString | pin () const |
Policy | policy () |
QString | serviceName () const |
void | setPersistence (Persistence persistence) |
void | setPin (const QString &pin) |
void | setPolicy (Policy policy) |
void | setTargets (Targets targets) |
Targets | targets () |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Additional Inherited Members | |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QObject | |
objectName | |
Detailed Description
Defines a rule indicating whether or not a certain service can be accessed by a certain machine.
Rules allow you to have control over which computers are allowed to access which services. Every time a message get's in, AuthorizationManager validates it's sender, and then checks it's list of rules for rules matching the sender and/or the service. If no rules match, or all matching rules have the value Unspecified, AuthorizationManager will create a new rule for this message, and invoke authorize on your shells implementation of AuthorizationInterface. Here, you can change that rule to either allow or deny that request. This class can be used to specify different types of rules:
- Rules matching only a user
- Rules matching only a service
- Rules matching both a service, and a user. A more specific rule always takes precedence over a more global rule: so if for example you have a rule for "myAwesomeService" specifying Deny, and a rule for "myAwesomeService" in combination with "130.42.120.146" as caller specifying Allow, only 130.42.120.146 can access myAwesomeService. By setting the PinRequired flag in setRules in an AuthorizationInterface implementation, you trigger Pin pairing (user will be asked to enter the same password on both machines).
- Since
- 4.4?
Definition at line 67 of file authorizationrule.h.
Member Enumeration Documentation
Enumerator | |
---|---|
Transient |
specify that this rule is just valid for this session. |
Persistent |
specify that this rule will be saved between sessions. |
Definition at line 79 of file authorizationrule.h.
Enumerator | |
---|---|
Deny |
access for messages matching this rule is denied. |
Allow |
access for messages matching this rule is allowed. |
PinRequired |
specify that the user will need to enter a pin at both sides |
Definition at line 73 of file authorizationrule.h.
Enumerator | |
---|---|
Default | |
AllUsers |
specify that this rule is valid for all users |
AllServices |
specify that this rule is valid for all services |
Definition at line 84 of file authorizationrule.h.
Constructor & Destructor Documentation
Plasma::AuthorizationRule::~AuthorizationRule | ( | ) |
Definition at line 89 of file authorizationrule.cpp.
Member Function Documentation
|
signal |
Credentials Plasma::AuthorizationRule::credentials | ( | ) | const |
- Returns
- the identity of the caller.
Definition at line 159 of file authorizationrule.cpp.
QString Plasma::AuthorizationRule::description | ( | ) | const |
- Returns
- a friendly and i18n'd description of the current rule, useful for creating a GUI to allow editing rules, or asking permission for an access attempt.
Definition at line 94 of file authorizationrule.cpp.
AuthorizationRule::Persistence Plasma::AuthorizationRule::persistence | ( | ) |
- Returns
- the flags describing this rule.
Definition at line 143 of file authorizationrule.cpp.
QString Plasma::AuthorizationRule::pin | ( | ) | const |
- Returns
- the pin for pin pairing.
Definition at line 154 of file authorizationrule.cpp.
AuthorizationRule::Policy Plasma::AuthorizationRule::policy | ( | ) |
- Returns
- the flags describing this rule.
Definition at line 121 of file authorizationrule.cpp.
QString Plasma::AuthorizationRule::serviceName | ( | ) | const |
- Returns
- the name of the service this rule applies to.
Definition at line 164 of file authorizationrule.cpp.
void Plasma::AuthorizationRule::setPersistence | ( | Persistence | persistence | ) |
- Parameters
-
rules the flags describing this rule.
Definition at line 137 of file authorizationrule.cpp.
void Plasma::AuthorizationRule::setPin | ( | const QString & | pin | ) |
- Parameters
-
pin set pin for pin pairing. You'll need to call this bevore setting the rule.
Definition at line 148 of file authorizationrule.cpp.
void Plasma::AuthorizationRule::setPolicy | ( | Policy | policy | ) |
- Parameters
-
rules the flags describing this rule.
Definition at line 115 of file authorizationrule.cpp.
void Plasma::AuthorizationRule::setTargets | ( | Targets | targets | ) |
- Parameters
-
rules the flags describing this rule.
Definition at line 126 of file authorizationrule.cpp.
AuthorizationRule::Targets Plasma::AuthorizationRule::targets | ( | ) |
- Returns
- the flags describing this rule.
Definition at line 132 of file authorizationrule.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:12 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.