AccountsService.UserManager¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w |
Usernames who are specifically excluded |
||
r/w |
Whether more than one normal user is present |
||
r/w |
Usernames who are specifically included |
||
r |
Determines whether or not the manager object is loaded and ready to read from. |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
Emitted when a user is added to the user manager. |
|
One of the users has changed |
|
One of the users has logged in or out. |
|
Emitted when a user is removed from the user manager. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
deprecated |
r |
||
parent |
r |
Class Details¶
- class AccountsService.UserManager(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A user manager object.
- classmethod get_default()¶
- Returns:
user manager object
- Return type:
Returns the user manager singleton instance. Calling this function will automatically being loading the user list if it isn’t loaded already. The
AccountsService.UserManager:is-loadedproperty will be set toTruewhen the users are finished loading and thenAccountsService.UserManager.list_users() can be called.
- activate_user_session(user)¶
- Parameters:
user (
AccountsService.User) – the user to activate- Returns:
whether successfully activated
- Return type:
Activate the session for a given user.
- cache_user(username)¶
- Parameters:
username (
str) – a user name- Raises:
- Returns:
user object
- Return type:
Caches a user account so it shows up via
AccountsService.UserManager.list_users().
- cache_user_async(username, cancellable, callback, *user_data)¶
- Parameters:
username (
str) – a unix user namecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject,Noneto ignorecallback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
Asynchronously caches a user account so it shows up via
AccountsService.UserManager.list_users().For more details, see
AccountsService.UserManager.cache_user(), which is the synchronous version of this call.New in version 0.6.27.
- cache_user_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – aGio.AsyncResult- Raises:
- Returns:
user object
- Return type:
Finishes an asynchronous user caching.
See
AccountsService.UserManager.cache_user_async().New in version 0.6.27.
- can_switch()¶
- Returns:
whether we can switch to another session
- Return type:
Check whether the user can switch to another session.
- create_user(username, fullname, accounttype)¶
- Parameters:
username (
str) – a unix user namefullname (
str) – a unix GECOS valueaccounttype (
AccountsService.UserAccountType) – aAccountsService.UserAccountType
- Raises:
- Returns:
user object
- Return type:
Creates a user account on the system.
- create_user_async(username, fullname, accounttype, cancellable, callback, *user_data)¶
- Parameters:
username (
str) – a unix user namefullname (
str) – a unix GECOS valueaccounttype (
AccountsService.UserAccountType) – aAccountsService.UserAccountTypecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject,Noneto ignorecallback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
Asynchronously creates a user account on the system.
For more details, see
AccountsService.UserManager.create_user(), which is the synchronous version of this call.New in version 0.6.27.
- create_user_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – aGio.AsyncResult- Raises:
- Returns:
user object
- Return type:
Finishes an asynchronous user creation.
See
AccountsService.UserManager.create_user_async().New in version 0.6.27.
- delete_user(user, remove_files)¶
- Parameters:
user (
AccountsService.User) – anAccountsService.Userobjectremove_files (
bool) –Trueto delete the users home directory
- Raises:
- Returns:
Trueif the user account was successfully deleted- Return type:
Deletes a user account on the system.
- delete_user_async(user, remove_files, cancellable, callback, *user_data)¶
- Parameters:
user (
AccountsService.User) – aAccountsService.Userobjectremove_files (
bool) –Trueto delete the users home directorycancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject,Noneto ignorecallback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
Asynchronously deletes a user account from the system.
For more details, see
AccountsService.UserManager.delete_user(), which is the synchronous version of this call.New in version 0.6.27.
- delete_user_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – aGio.AsyncResult- Raises:
- Returns:
Trueif the user account was successfully deleted- Return type:
Finishes an asynchronous user account deletion.
See
AccountsService.UserManager.delete_user_async().New in version 0.6.27.
- get_user(username)¶
- Parameters:
username (
str) – the login name of the user to get.- Returns:
AccountsService.Userobject- Return type:
Retrieves a pointer to the
AccountsService.Userobject for the login username from self. Trying to use this object before itsAccountsService.User:is-loadedproperty isTruewill result in undefined behavior.
- get_user_by_id(id)¶
- Parameters:
id (
int) – the uid of the user to get.- Returns:
AccountsService.Userobject- Return type:
Retrieves a pointer to the
AccountsService.Userobject for the user with the given uid from self. Trying to use this object before itsAccountsService.User:is-loadedproperty isTruewill result in undefined behavior.
- goto_login_session()¶
- Returns:
whether successful or not
- Return type:
Switch the display to the login manager.
- list_users()¶
- Returns:
List of
AccountsService.Userobjects- Return type:
Get a list of system user accounts
- no_service()¶
- Returns:
whether or not accounts service is running
- Return type:
Check whether or not the accounts service is running.
- uncache_user(username)¶
- Parameters:
username (
str) – a user name- Raises:
- Returns:
- Return type:
Releases all metadata about a user account, including icon, language and session. If the user account is from a remote server and the user has never logged in before, then that account will no longer show up in ListCachedUsers() output.
- uncache_user_async(username, cancellable, callback, *user_data)¶
- Parameters:
username (
str) –cancellable (
Gio.CancellableorNone) –callback (
Gio.AsyncReadyCallbackorNone) –
- uncache_user_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – aGio.AsyncResult- Raises:
- Returns:
Trueif the user account was successfully uncached- Return type:
Finishes an asynchronous user uncaching.
See
AccountsService.UserManager.uncache_user_async().New in version 0.6.39.
- do_user_added(user) virtual¶
- Parameters:
user (
AccountsService.User) –
- do_user_changed(user) virtual¶
- Parameters:
user (
AccountsService.User) –
- do_user_is_logged_in_changed(user) virtual¶
- Parameters:
user (
AccountsService.User) –
- do_user_removed(user) virtual¶
- Parameters:
user (
AccountsService.User) –
Signal Details¶
- AccountsService.UserManager.signals.user_added(user_manager, user)¶
- Signal Name:
user-added- Flags:
- Parameters:
user_manager (
AccountsService.UserManager) – The object which received the signaluser (
AccountsService.User) – theAccountsService.Userthat was added
Emitted when a user is added to the user manager.
- AccountsService.UserManager.signals.user_changed(user_manager, user)¶
- Signal Name:
user-changed- Flags:
- Parameters:
user_manager (
AccountsService.UserManager) – The object which received the signaluser (
AccountsService.User) – theAccountsService.Userthat changed
One of the users has changed
- AccountsService.UserManager.signals.user_is_logged_in_changed(user_manager, user)¶
- Signal Name:
user-is-logged-in-changed- Flags:
- Parameters:
user_manager (
AccountsService.UserManager) – The object which received the signaluser (
AccountsService.User) – theAccountsService.Userthat changed login status
One of the users has logged in or out.
- AccountsService.UserManager.signals.user_removed(user_manager, user)¶
- Signal Name:
user-removed- Flags:
- Parameters:
user_manager (
AccountsService.UserManager) – The object which received the signaluser (
AccountsService.User) – theAccountsService.Userthat was removed
Emitted when a user is removed from the user manager.
Property Details¶
- AccountsService.UserManager.props.exclude_usernames_list¶
-
Usernames who are specifically excluded
- AccountsService.UserManager.props.has_multiple_users¶
-
Whether more than one normal user is present
- AccountsService.UserManager.props.include_usernames_list¶
-
Usernames who are specifically included