tik_manager4.objects.user

User module for Tik Manager 4.

Attributes

FEED

LOG

Classes

User

User class to handle user data and permissions.

UserSettings

Customized settings for the User class.

Module Contents

class User(common_directory=None)

User class to handle user data and permissions.

add_project_bookmark(project_path)

Add a new project bookmark to the user bookmarks.

Args:

project_path (str): The project path.

Returns:

int: 1 if successful, -1 otherwise.

add_recent_commons(commons_path)

Add the commons path to the recent commons list.

add_recent_project(path)

Add a project to the recent projects list.

Args:

path (str): The project path.

Returns:

int: 1 if successful, -1 otherwise.

authenticate(password)

Authenticate the active user with the given password.

Args:

password (str): The password.

Returns:

tuple: (1, “Success”) if successful, (-1, LOG.warning) otherwise.

change_permission_level(user_name, new_level, active_user_password=None)

Change the permission level of a user.

Args:

user_name (str): The user name. new_level (int): The new permission level. active_user_password (str, optional): The password of the

active user. If not provided, the user will be authenticated with the hash in the database.

Returns:

tuple: (1, “Success”) if successful, (-1, LOG.warning) otherwise.

change_user_password(old_password, new_password, user_name=None)

Change the user password.

It only changes the active user, a.k.a needs to be logged in.

Args:

old_password (str): The old password. new_password (str): The new password. user_name (str, optional): The user name. If not provided, the

active user will be used.

check_password(user_name, password)

Check the given password against the hashed password.

Args:

user_name (str): The user name. password (str): The password.

Returns:

bool: True if the password is correct, False otherwise.

check_permissions(level)

Checks the user permissions for project actions.

Args:

level (int): Permission level to be checked against.

Returns:

int: 1 if the user has the permission, -1 otherwise.

create_new_user(new_user_name, new_user_initials, new_user_password, permission_level, active_user_password=None, email=None)

Create a new user and stores it in database.

Args:

new_user_name (str): The new user name. new_user_initials (str): The new user initials. new_user_password (str): The new user password. permission_level (int): The permission level. active_user_password (str, optional): The password of the

active user.

email (str, optional): The email address of the user.

Returns:

tuple: (1, “Success”) if successful, (-1, LOG.warning) otherwise.

delete_project_bookmark(project_path)

Delete a project bookmark from the user bookmarks.

Args:

project_path (str): The project path.

Returns:

int: 1 if successful, -1 otherwise.

delete_user(user_name, active_user_password=None)

Remove the user from database.

Args:

user_name (str): The user name. active_user_password (str, optional): The password of the

active user. If not provided, the user will be authenticated with the hash in the database.

Returns:

tuple: (1, “Success”) if successful, (-1, LOG.warning) otherwise.

get()

Return the currently active user.

get_project_bookmarks()

Return the user bookmarked projects as list of dictionaries.

get_recent_commons()

Return the list of recent commons.

get_recent_projects()

Return the list of recent projects.

reset_user_password(new_password, user_name) tik_manager4.core.constants.ValidationResult

Reset the password for the specified user.

This operation can only be performed by users with admin privileges.

Args:

new_password (str): The new password to assign to the user. user_name (str): The user name.

Returns:

object: ValidationResult object.

set(user_name, password=None, save_to_db=True, clear_db=False)

Set the active user to the session.

Args:

user_name (str): The user name. password (str, optional): The password. If not provided, the user

will be authenticated with the hash in the database.

save_to_db (bool, optional): If True, a hash of the user name and

password will be saved to the database for auto-login.

clear_db (bool, optional): If True the hash will be cleared from

the database.

Returns:

tuple: (1, “Success”) if successful, (-1, LOG.warning) otherwise.

property bookmark_names
Names of the user bookmarks.
property column_sizes
Column sizes.
property email
Active User Email.
property expanded_subprojects
The expansion states of subprojects.
property is_authenticated
Authentication Status for the active user.
property last_category
The last category interacted with.
property last_project
The last project interacted with.
property last_subproject
The last subproject interacted with.
property last_task
The last task interacted with.
property last_version
The last version interacted with.
property last_work
The last category interacted with.
property main_window_state
Retrieve the geometric position and scale of the main window.
property name
Active User Name.
object_type
property permission_level
Permission Level of the active user.
property split_sizes
The split sizes to apply to the main UI.
property ui_elements
The GUI elements.
property visible_columns
The column visibilities.
class UserSettings

Bases: tik_manager4.core.settings.Settings

Customized settings for the User class.

apply_settings(force=False)

Apply the settings to the file.

FEED
LOG