KUserGroup Class Reference
from PyKDE5.kcoreaddons import *
Detailed Description
\class KUserGroup kuser.h <KUserGroup>
Represents a group on your system
This class represents a group on your system. You can either get information about the group of the current user, of fetch information about a group on the system. Instances of this class will be explicitly shared, so copying objects is very cheap and you can safely pass objects by value.
Methods | |
__init__ (self, QString name) | |
__init__ (self, QString name) | |
__init__ (self, KUser::UIDMode mode=KUser.UseEffectiveUID) | |
__init__ (self, long gid) | |
__init__ (self, KUserGroup group) | |
__init__ (self, KGroupId gid) | |
KGroupId | groupId (self) |
bool | isValid (self) |
QString | name (self) |
bool | operator != (self, KUserGroup group) |
bool | operator == (self, KUserGroup group) |
QStringList | userNames (self, long maxCount=0xffffffff) |
[KUser] | users (self, long maxCount=0xffffffff) |
Static Methods | |
QStringList | allGroupNames (long maxCount=0xffffffff) |
[KUserGroup] | allGroups (long maxCount=0xffffffff) |
Method Documentation
__init__ | ( | self, | ||
QString | name | |||
) |
Create an object from a group name. If the group does not exist, isValid() will return false.
- Parameters:
-
name the name of the group
__init__ | ( | self, | ||
QString | name | |||
) |
Create an object from a group name. If the group does not exist, isValid() will return false.
- Parameters:
-
name the name of the group
__init__ | ( | self, | ||
KUser::UIDMode | mode=KUser.UseEffectiveUID | |||
) |
Create an object from the group of the current user.
- Parameters:
-
mode if #KUser.UseEffectiveUID is passed the effective user will be used. If #KUser.UseRealUserID is passed the real user will be used. The real UID will be different than the effective UID in setuid programs; in such a case use the effective UID for checking permissions, and the real UID for displaying information about the group associated with the user.
__init__ | ( | self, | ||
long | gid | |||
) |
Create an object from a group id. If the group does not exist, isValid() will return false.
- Parameters:
-
gid the group id
__init__ | ( | self, | ||
KUserGroup | group | |||
) |
Creates a new KUserGroup instance from another KUserGroup object
- Parameters:
-
group the KUserGroup to copy
__init__ | ( | self, | ||
KGroupId | gid | |||
) |
Create an object from a group id. If the group does not exist, isValid() will return false.
- Parameters:
-
gid the group id
KGroupId groupId | ( | self ) |
- Returns:
- the native group id of the user.
bool isValid | ( | self ) |
Returns whether the group is valid. A KUserGroup object can be invalid if it is created with a non-existing gid or name.
- Returns:
- true if the group is valid
QString name | ( | self ) |
The name of the group.
- Returns:
- the name of the group
bool operator != | ( | self, | ||
KUserGroup | group | |||
) |
bool operator == | ( | self, | ||
KUserGroup | group | |||
) |
QStringList userNames | ( | self, | ||
long | maxCount=0xffffffff | |||
) |
- Parameters:
-
maxCount the maximum number of groups to return
- Returns:
- a list of all user login names of the group
[KUser] users | ( | self, | ||
long | maxCount=0xffffffff | |||
) |
- Parameters:
-
maxCount the maximum number of users to return
- Returns:
- a list of all users of the group
Static Method Documentation
QStringList allGroupNames | ( | long | maxCount=0xffffffff | |
) |
- Parameters:
-
maxCount the maximum number of groups to return
- Returns:
- a list of all group names on this system
[KUserGroup] allGroups | ( | long | maxCount=0xffffffff | |
) |
- Parameters:
-
maxCount the maximum number of groups to return
- Returns:
- a list of all groups on this system