/* TODO: check if caller is authorized */
+ /* We can only add temporary authorizations to users, not e.g. groups */
+ if (subject != NULL && !POLKIT_IS_UNIX_USER (identity))
+ {
+ polkit_backend_pending_call_return_error (pending_call,
+ POLKIT_ERROR,
+ POLKIT_ERROR_FAILED,
+ "Can only add temporary authorizations to users");
+ goto out;
+ }
+
if (!add_authorization_for_identity (local_authority,
identity,
authorization,
polkit_backend_authority_add_authorization_finish (pending_call);
}
+ out:
g_free (subject_str);
}
/* TODO: check if caller is authorized */
+ /* We can only remove temporary authorizations to users, not e.g. groups */
+ if (subject != NULL && !POLKIT_IS_UNIX_USER (identity))
+ {
+ polkit_backend_pending_call_return_error (pending_call,
+ POLKIT_ERROR,
+ POLKIT_ERROR_FAILED,
+ "Can only remove temporary authorizations from users");
+ goto out;
+ }
+
if (!remove_authorization_for_identity (local_authority,
identity,
authorization,
polkit_backend_authority_remove_authorization_finish (pending_call);
}
+ out:
+
g_free (subject_str);
}