diff options
author | Dan Williams <dcbw@redhat.com> | 2010-02-26 18:01:55 -0800 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2010-02-26 18:01:55 -0800 |
commit | 438a047935f941e8f7d8df27a0069c70e4b4ea05 (patch) | |
tree | 8933f938d30e44ec4acb8f4a1c775789de90e9ae /src/mm-modem.h | |
parent | b9958e6ec5115822b1c2112da5ef2652aa847a51 (diff) |
core: add authorization providers and optional PolicyKit support
When the support is complete, use --with-polkit to enable
PolicyKit support. It's not there yet, but this commit adds an
authorization provider framework which will be extended to allow
hooking into PolicyKit.
Diffstat (limited to 'src/mm-modem.h')
-rw-r--r-- | src/mm-modem.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/mm-modem.h b/src/mm-modem.h index ead2cca5..531ca785 100644 --- a/src/mm-modem.h +++ b/src/mm-modem.h @@ -20,6 +20,7 @@ #include <glib-object.h> #include "mm-port.h" +#include "mm-auth-provider.h" typedef enum { MM_MODEM_STATE_UNKNOWN = 0, @@ -156,6 +157,21 @@ struct _MMModem { MMModemInfoFn callback, gpointer user_data); + /* Normally implemented by the modem base class; plugins should + * never need to implement this. + */ + gboolean (*auth_request) (MMModem *self, + const char *authorization, + MMAuthRequestCb callback, + gpointer callback_data, + GDestroyNotify notify, + GError **error); + + gboolean (*auth_finish) (MMModem *self, + guint32 reqid, + MMAuthResult result, + GError **error); + /* Signals */ void (*state_changed) (MMModem *self, MMModemState new_state, @@ -217,5 +233,21 @@ void mm_modem_set_state (MMModem *self, GError *mm_modem_check_removed (MMModem *self, const GError *error); +/* Request authorization to perform an action. Used by D-Bus method + * handlers to ensure that the incoming request is authorized to perform + * the action it's requesting. + */ +gboolean mm_modem_auth_request (MMModem *self, + const char *authorization, + MMAuthRequestCb callback, + gpointer callback_data, + GDestroyNotify notify, + GError **error); + +gboolean mm_modem_auth_finish (MMModem *self, + guint32 reqid, + MMAuthResult result, + GError **error); + #endif /* MM_MODEM_H */ |