PolkitUnixUser: polkit Reference Manual

## PolkitUnixUser PolkitUnixUser — Unix users |

## Functions

PolkitIdentity * | polkit_unix_user_new ()
PolkitIdentity * | polkit_unix_user_new_for_name ()
gint | polkit_unix_user_get_uid ()
void | polkit_unix_user_set_uid ()
const gchar * | polkit_unix_user_get_name ()

## Properties

int | uid | Read / Write / Construct

## Types and Values

| PolkitUnixUser

## Object Hierarchy

        GObject
        ╰── PolkitUnixUser

## Implemented Interfaces

PolkitUnixUser implements PolkitIdentity.

## Description

An object representing a user identity on a UNIX system.

## Functions

### polkit_unix_user_new ()

    PolkitIdentity *
    polkit_unix_user_new (gint uid);

Creates a new PolkitUnixUser object for `uid` .

#### Parameters

uid | A UNIX user id. |

#### Returns

A PolkitUnixUser object. Free with `g_object_unref()`.

[transfer full]

### polkit_unix_user_new_for_name ()

    PolkitIdentity *
    polkit_unix_user_new_for_name (const gchar *name,
                                   GError **error);

Creates a new PolkitUnixUser object for a user with the user name `name` .

#### Parameters

name | A UNIX user name. |
error | Return location for error. |

#### Returns

A PolkitUnixUser object or `NULL` if `error` is set.

[allow-none][transfer full]

### polkit_unix_user_get_uid ()

    gint
    polkit_unix_user_get_uid (PolkitUnixUser *user);

Gets the UNIX user id for `user` .

#### Parameters

user | A PolkitUnixUser. |

#### Returns

A UNIX user id.

### polkit_unix_user_set_uid ()

    void
    polkit_unix_user_set_uid (PolkitUnixUser *user,
                              gint uid);

Sets `uid` for `user` .

#### Parameters

user | A PolkitUnixUser. |
uid | A UNIX user id. |

### polkit_unix_user_get_name ()

    const gchar *
    polkit_unix_user_get_name (PolkitUnixUser *user);

Get the user's name.

#### Parameters

user | A PolkitUnixUser. |

#### Returns

User name string or `NULL` if user uid not found.

[allow-none][transfer none]

## Types and Values

### PolkitUnixUser

    typedef struct _PolkitUnixUser PolkitUnixUser;

The PolkitUnixUser struct should not be accessed directly.

## Property Details

### The `“uid”` property

      “uid”                      int

The UNIX user id.

Owner: PolkitUnixUser

Flags: Read / Write / Construct

Default value: -1