Skip to content

webknossos.administration.user

Classes:

LoggedTime

Attributes:

duration_in_seconds instance-attribute

duration_in_seconds: int

month instance-attribute

month: int

year instance-attribute

year: int

Team

Methods:

  • add

    Adds a new team with the specified name.

  • get_by_name

    Returns the Team specified by the passed name if your token authorizes you to see it.

  • get_list

    Returns all teams of the current user.

Attributes:

id instance-attribute

id: str

name instance-attribute

name: str

organization_id instance-attribute

organization_id: str

add classmethod

add(team_name: str) -> None

Adds a new team with the specified name.

get_by_name classmethod

get_by_name(name: str) -> Team

Returns the Team specified by the passed name if your token authorizes you to see it.

get_list classmethod

get_list() -> List[Team]

Returns all teams of the current user.

User

Represents a user of a webknossos instance. You can get users via get_current_user and get_all_managed_users.

Methods:

  • assign_team_roles

    Assigns the specified roles to the user for the specified team.

  • get_all_managed_users

    Returns all users of whom the current user is admin or team-manager.

  • get_by_id

    Returns the user specified by the passed id if your token authorizes you to see them.

  • get_current_user

    Returns the current user from the authentication context.

  • get_logged_times

    Get the logged times of this user.

Attributes:

created instance-attribute

created: int

email instance-attribute

email: str

experiences instance-attribute

experiences: Dict[str, int]

first_name instance-attribute

first_name: str

is_active instance-attribute

is_active: bool

is_admin instance-attribute

is_admin: bool

is_dataset_manager instance-attribute

is_dataset_manager: bool

last_activity instance-attribute

last_activity: int

last_name instance-attribute

last_name: str

organization_id instance-attribute

organization_id: str

teams instance-attribute

teams: Tuple[Team, ...]

user_id instance-attribute

user_id: str

assign_team_roles

assign_team_roles(team_name: str, is_team_manager: bool) -> None

Assigns the specified roles to the user for the specified team.

get_all_managed_users classmethod

get_all_managed_users() -> List[User]

Returns all users of whom the current user is admin or team-manager.

get_by_id classmethod

get_by_id(id: str) -> User

Returns the user specified by the passed id if your token authorizes you to see them.

get_current_user classmethod

get_current_user() -> User

Returns the current user from the authentication context.

get_logged_times

get_logged_times() -> List[LoggedTime]

Get the logged times of this user. Returns a list of LoggedTime objects where one represents one month.