Skip to content

webknossos.administration.user

class User:

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

User( user_id: str, email: str, organization_id: str, first_name: str, last_name: str, created: int, last_activity: int, teams: tuple[webknossos.administration.user.Team, ...], experiences: Dict[str, int], is_active: bool, is_admin: bool, is_dataset_manager: bool)

Method generated by attrs for class User.

user_id: str
email: str
organization_id: str
first_name: str
last_name: str
created: int
last_activity: int
experiences: Dict[str, int]
is_active: bool
is_admin: bool
is_dataset_manager: bool
def get_logged_times(self) -> list[webknossos.administration.user.LoggedTime]:

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

@classmethod
def get_by_id(cls, id: str) -> webknossos.administration.user.User:

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

@classmethod
def get_current_user(cls) -> webknossos.administration.user.User:

Returns the current user from the authentication context.

@classmethod
def get_all_managed_users(cls) -> list[webknossos.administration.user.User]:

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

class Team:
Team(id: str, name: str, organization_id: str)

Method generated by attrs for class Team.

id: str
name: str
organization_id: str
@classmethod
def get_by_name(cls, name: str) -> webknossos.administration.user.Team:

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

class LoggedTime:
LoggedTime(duration_in_seconds: int, year: int, month: int)

Method generated by attrs for class LoggedTime.

duration_in_seconds: int
year: int
month: int