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 () |
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-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:35 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.