diff --git a/src/core/slavebase.h b/src/core/slavebase.h --- a/src/core/slavebase.h +++ b/src/core/slavebase.h @@ -943,6 +943,15 @@ */ PrivilegeOperationStatus requestPrivilegeOperation(); + /** + * Adds @p action to the list of PolicyKit actions which the + * slave is authorized to perform. + * + * @param action the PolicyKit action + * @since 5.45 + */ + void addTemporaryAuthorization(const QString &action); + protected: /** * Name of the protocol supported by this slave diff --git a/src/core/slavebase.cpp b/src/core/slavebase.cpp --- a/src/core/slavebase.cpp +++ b/src/core/slavebase.cpp @@ -122,6 +122,7 @@ KPasswdServerClient *m_passwdServerClient; bool m_rootEntryListed = false; + QSet m_tempAuths; QString m_warningCaption; QString m_warningMessage; bool m_confirmationAsked; @@ -1497,3 +1498,8 @@ return KIO::PrivilegeOperationStatus(d->m_privilegeOperationStatus); } + +void SlaveBase::addTemporaryAuthorization(const QString &action) +{ + d->m_tempAuths.insert(action); +}