:right-sidebar: True Credentials =================================================================== .. currentmodule:: gi.repository.Gio .. versionadded:: 2.26 .. class:: Credentials(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` :Constructors: :: Credentials(**properties) new() -> Gio.Credentials Constructors ------------ .. rst-class:: interim-class .. class:: Credentials :no-index: .. classmethod:: new() -> ~gi.repository.Gio.Credentials Creates a new :obj:`~gi.repository.Gio.Credentials` object with credentials matching the the current process. .. versionadded:: 2.26 Methods ------- .. rst-class:: interim-class .. class:: Credentials :no-index: .. method:: get_unix_pid() -> int Tries to get the UNIX process identifier from ``credentials``. This method is only available on UNIX platforms. This operation can fail if :obj:`~gi.repository.Gio.Credentials` is not supported on the OS or if the native credentials type does not contain information about the UNIX process ID. .. versionadded:: 2.36 .. method:: get_unix_user() -> int Tries to get the UNIX user identifier from ``credentials``. This method is only available on UNIX platforms. This operation can fail if :obj:`~gi.repository.Gio.Credentials` is not supported on the OS or if the native credentials type does not contain information about the UNIX user. .. versionadded:: 2.26 .. method:: is_same_user(other_credentials: ~gi.repository.Gio.Credentials) -> bool Checks if ``credentials`` and ``other_credentials`` is the same user. This operation can fail if :obj:`~gi.repository.Gio.Credentials` is not supported on the the OS. .. versionadded:: 2.26 :param other_credentials: A :obj:`~gi.repository.Gio.Credentials`. .. method:: set_native(native_type: ~gi.repository.Gio.CredentialsType, native: None) -> None Copies the native credentials of type ``native_type`` from ``native`` into ``credentials``. It is a programming error (which will cause a warning to be logged) to use this method if there is no :obj:`~gi.repository.Gio.Credentials` support for the OS or if ``native_type`` isn't supported by the OS. .. versionadded:: 2.26 :param native_type: The type of native credentials to set. :param native: A pointer to native credentials. .. method:: set_unix_user(uid: int) -> bool Tries to set the UNIX user identifier on ``credentials``. This method is only available on UNIX platforms. This operation can fail if :obj:`~gi.repository.Gio.Credentials` is not supported on the OS or if the native credentials type does not contain information about the UNIX user. It can also fail if the OS does not allow the use of "spoofed" credentials. .. versionadded:: 2.26 :param uid: The UNIX user identifier to set. .. method:: to_string() -> str Creates a human-readable textual representation of ``credentials`` that can be used in logging and debug messages. The format of the returned string may change in future GLib release. .. versionadded:: 2.26