Group¶
Todo
Docstrings (module)
Models¶
-
class
indico.modules.groups.models.groups.
LocalGroup
(**kwargs)¶ Bases:
sqlalchemy.orm.decl_api.Model
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
id
¶ the unique id of the group
-
members
¶ the users in the group
-
name
¶ the name of the group
-
proxy
¶ Return a GroupProxy wrapping this group.
-
-
class
indico.modules.groups.core.
GroupProxy
¶ Bases:
object
Provide a generic interface for both local and multipass groups.
Creating an instance of this class actually creates either a
LocalGroupProxy
or aMultipassGroupProxy
, but they expose the same API.Parameters: - name_or_id – The name of a multipass group or ID of a local group
- provider – The provider of a multipass group
Create the correct GroupProxy for the group type.
-
as_principal
¶ The serializable principal identifier of this group.
-
get_members
()¶ Get the list of users who are members of the group.
-
group
¶ The underlying group object.
-
has_member
(user)¶ Check if the user is a member of the group.
This can also be accessed using the
in
operator.
-
identifier
¶
-
principal_order
= 3¶
-
classmethod
search
(name, exact=False, providers=None)¶ Search for groups.
Parameters: - name – The group name to search for.
- exact – If only exact matches should be found (much faster)
- providers –
None
to search in all providers and local groups. May be a set specifying providers to search in. For local groups, the'indico'
provider name may be used.