gpointer user_data)
{
CheckAuthData *data = user_data;
- PolkitAuthorizationResult result;
+ PolkitAuthorizationResult *result;
GError *error;
gboolean is_authorized;
"Not Authorized: %s", error->message);
g_error_free (error);
} else {
- if (result == POLKIT_AUTHORIZATION_RESULT_NOT_AUTHORIZED) {
- throw_error (data->context,
- DEVKIT_DISKS_ERROR_PERMISSION_DENIED,
- "Not Authorized");
- } else if (result == POLKIT_AUTHORIZATION_RESULT_CHALLENGE) {
+ if (polkit_authorization_result_get_is_authorized (result)) {
+ is_authorized = TRUE;
+ } else if (polkit_authorization_result_get_is_challenge (result)) {
throw_error (data->context,
DEVKIT_DISKS_ERROR_PERMISSION_DENIED,
"Authentication is required");
} else {
- is_authorized = TRUE;
+ throw_error (data->context,
+ DEVKIT_DISKS_ERROR_PERMISSION_DENIED,
+ "Not Authorized");
}
+ g_object_unref (result);
}
if (is_authorized) {
}
check_auth_data_free (data);
-
}
/* num_user_data param is followed by @num_user_data (gpointer, GDestroyNotify) pairs.. */