Group

Todo

Docstrings (module)

Models

class indico.modules.groups.models.groups.LocalGroup(**kwargs)

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

in_event_settings_acls
in_settings_acls
members

the users in the group

name

the name of the group

property proxy

Return a GroupProxy wrapping this group.

query: IndicoBaseQuery

A SQLAlchemy query for a model. Equivalent to db.session.query(Model). Can be customized per-model by overriding query_class.

Warning

The query interface is considered legacy in SQLAlchemy. Prefer using session.execute(select()) instead.

class indico.modules.groups.core.GroupProxy(name_or_id, provider=None, _group=None)

Provide a generic interface for both local and multipass groups.

Creating an instance of this class actually creates either a LocalGroupProxy or a MultipassGroupProxy, 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.

property as_principal

The serializable principal identifier of this group.

get_members()

Get the list of users who are members of the group.

property 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.

property 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)

  • providersNone 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.

Utilities

indico.modules.groups.util.serialize_group(group)

Serialize group to JSON-like object.