34 SignonIdentityAdaptor::SignonIdentityAdaptor(SignonIdentity *parent):
35 QDBusAbstractAdaptor(parent),
38 setAutoRelaySignals(
true);
41 SignonIdentityAdaptor::~SignonIdentityAdaptor()
45 void SignonIdentityAdaptor::securityErrorReply(
const char *failedMethodName)
48 QTextStream(&errMsg) << SIGNOND_PERMISSION_DENIED_ERR_STR
52 errorReply(SIGNOND_PERMISSION_DENIED_ERR_NAME, errMsg);
53 TRACE() <<
"Method FAILED Access Control check:" << failedMethodName;
56 void SignonIdentityAdaptor::errorReply(
const QString &name,
57 const QString &message)
59 QDBusMessage msg = parentDBusContext().message();
60 msg.setDelayedReply(
true);
61 QDBusMessage errReply = msg.createErrorReply(name, message);
62 parentDBusContext().connection().send(errReply);
69 parentDBusContext().connection(),
70 parentDBusContext().message(),
72 securityErrorReply(__func__);
76 return m_parent->requestCredentialsUpdate(msg);
83 parentDBusContext().connection(),
84 parentDBusContext().message(),
86 securityErrorReply(__func__);
90 return m_parent->getInfo();
97 parentDBusContext().connection(),
98 parentDBusContext().message(),
100 securityErrorReply(__func__);
104 if (!m_parent->addReference(reference)) {
106 errorReply(SIGNOND_OPERATION_FAILED_ERR_NAME,
107 SIGNOND_OPERATION_FAILED_ERR_STR);
115 parentDBusContext().connection(),
116 parentDBusContext().message(),
118 securityErrorReply(__func__);
122 if (!m_parent->removeReference(reference)) {
124 errorReply(SIGNOND_OPERATION_FAILED_ERR_NAME,
125 SIGNOND_OPERATION_FAILED_ERR_STR);
134 parentDBusContext().connection(),
135 parentDBusContext().message(),
137 securityErrorReply(__func__);
141 return m_parent->verifyUser(params);
148 parentDBusContext().connection(),
149 parentDBusContext().message(),
151 securityErrorReply(__func__);
155 return m_parent->verifySecret(secret);
163 parentDBusContext().connection(),
164 parentDBusContext().message(),
171 parentDBusContext().connection(),
172 parentDBusContext().message())) {
173 securityErrorReply(__func__);
185 parentDBusContext().connection(),
186 parentDBusContext().message(),
188 securityErrorReply(__func__);
192 return m_parent->signOut();
197 quint32
id = info.value(QLatin1String(
"Id"), SIGNOND_NEW_IDENTITY).toInt();
199 if (
id != SIGNOND_NEW_IDENTITY) {
202 parentDBusContext().connection(),
203 parentDBusContext().message(),
210 parentDBusContext().connection(),
211 parentDBusContext().message())) {
213 securityErrorReply(__func__);
218 return m_parent->store(info);
quint32 store(const QVariantMap &info)
quint32 requestCredentialsUpdate(const QString &message)
static AccessControlManagerHelper * instance()
bool isPeerKeychainWidget(const QDBusConnection &peerConnection, const QDBusMessage &peerMessage)
void removeReference(const QString &reference)
void addReference(const QString &reference)
IdentityOwnership
Specifies the owner relationship of an application over a specific identity, or the lack of ownership...
IdentityOwnership isPeerOwnerOfIdentity(const QDBusConnection &peerConnection, const QDBusMessage &peerMessage, const quint32 identityId)
Checks if a specific process is the owner of a SignonIdentity, thus having full control over it...
bool verifySecret(const QString &secret)
Helper class for access control-related functionality.
bool verifyUser(const QVariantMap ¶ms)