API DocumentationDocumentation for developing SailfishOS applications
|void||addToGroups(uint uid, const QStringList &groups)|
|uint||addUser(const QString &name)|
|void||modifyUser(uint uid, const QString &new_name)|
|void||removeFromGroups(uint uid, const QStringList &groups)|
|void||userAdded(const SailfishUserManagerEntry &user)|
|void||userModified(uint uid, const QString &new_name)|
The SailfishUserManager provides tools for user management.
This is a D-Bus interface to list, create, remove and modify users. It is provided by
org.sailfishos.usermanager service on system bus with path
/ and interface
Some operations may return
QDBusError::AccessDenied if caller is not authorized to do them and
QDBusError::InvalidArgs if arguments are not acceptable.
Member Function Documentation
Triggered when system is about to change current user to user with uid.
This is mainly useful for user interface to show information about switching users. User session is ended a moment later and currentUserChanged will follow this signal.
Adds user with given uid to groups.
This is used to add permissions for user. All groups must begin with
Creates user with name as real name.
New users can not be created if there are already maximum number of users. Guest user is not counted to this maximum. name must not be empty and it may not contain
, characters. In practice it is recommended to only have letters, numbers, spaces, dots and dashes in name.
Returns UID (User IDentifier) of the new user. Use users to get username if needed.
Returns current user's UID (User IDentifier).
Current user is the user that is using the device, i.e. is active on
See also setCurrentUser().
Triggered when changing current user fails.
This follows aboutToChangeCurrentUser when changing current user to user with uid fails.
The system may be in unusable state after this signal or it may have recovered successfully. Rebooting device usually recovers this.
Triggered when current user is changed.
Current user is set to user with uid.
Returns UUID (Universally Unique IDentifier) for current user.
Enables or disables guest user.
Argument enable chooses whether guest user should be enabled or not.
Triggered when guest user is enabled or disabled.
If enabled is
true, guest user is enabled, otherwise it is disabled.
Changes real name to new_name for user with given uid.
Removes user with uid from groups.
This is used to remove permissions from user. All groups must begin with
Removes user with given uid from the system.
Only additional users can be removed. Current user or Device owner can not be removed. See enableGuestUser for disabling guest user.
Warning: Removing a user destroys all data for that user.
This may return error SailfishUserManagerErrorUserRemoveFailed.
Sets current user to user with given uid.
This will end current user session and start user session for uid which must be different from current user's UID.
See also currentUser().
[signal] void SailfishUserManager::userAdded(const SailfishUserManagerEntry &user)
Triggered when a new user has been added.
User information is contained in user.
See also SailfishUserManagerEntry.
Triggered when user's real name has been changed.
User with uid has new_name as their new real name.
Triggered when user with uid has been removed.
Returns UUID (Universally Unique IDentifier) for user with given uid.
This may return error SailfishUserManagerErrorGetUuidFailed.
[slot] QList<SailfishUserManagerEntry> SailfishUserManager::users()
List users on device.
Returns list of SailfishUserManagerEntry structs.
If list of users can not be fetched this returns error
Returns groups for user with given uid.