x2gobroker.nameservices.base_nameservice module¶
-
class
x2gobroker.nameservices.base_nameservice.X2GoBrokerNameService[source]¶ Bases:
object-
get_group_members(group, primary_groups=False)[source]¶ Retrieve a list of users being members of a given group.
Optionally, primary group memberships can be considered (or not).
Parameters: - group (
str) – name of the group to retrieve members of - primary_groups (
bool) – take primary group membership into consideration or not
Returns: list of users that are members of the given group
Return type: list- group (
-
get_groups()[source]¶ Retrieve list of groups known to the broker.
Returns: list of known group names Return type: list
-
get_primary_group(username)[source]¶ Get the primary group of a given user. If the nameservices backend in use does not support primary groups, an empty string will be returned.
Parameters: username ( str) – name of the user to get the primary group forReturns: name of the primary group of the given user Return type: str
-
get_user_groups(username, primary_groups=False)[source]¶ Retrieve a list of groups that a given user is member of.
Optionally, primary group memberships can be considered (or not).
Parameters: - username (
str) – name of the user to retrieve groupm memberships of - primary_groups (
bool) – take primary group membership into consideration or not
Returns: list of groups that the given user is member of
Return type: list- username (
-
get_users()[source]¶ Retrieve list of users known to the broker.
Returns: list of known user names Return type: list
-
has_group(group)[source]¶ Provide information, if the broker knows a given group (or not).
Parameters: group ( str) – name of the group to checkReturns: Trueif the group is known to the broker,Falseif notReturn type: bool
-
has_user(username)[source]¶ Provide information, if the broker knows a given user (or not).
Parameters: username ( str) – name of the user to checkReturns: Trueif the user is known to the broker,Falseif notReturn type: bool
-
is_group_member(username, group, primary_groups=False)[source]¶ Check, if a given user is member of a given group.
Optionally, primary group memberships can be considered (or not).
Parameters: - username (
str) – name of the user to check - group (
str) – name of the group to check - primary_groups (
bool) – take primary group membership into consideration or not
Returns: Trueif the user is member of the given group,Falseif notReturn type: bool- username (
-