utils.py

This util module provides help functions for checking if an user is in the appropiate group.

Function definitions:

apps.healthperson.utils.is_allowed(user, white_list=[])[source]

Checks if the user’s group is in provided list with white listed groups.

Args:
  • user: the user instance to check
  • while_list: a list with group names the user should be in.
Returns:
True is the user is in provided group white_list
apps.healthperson.utils.is_allowed_patient(user)[source]

Shortcut for checking if the user is a patient

apps.healthperson.utils.is_allowed_secretary(user)[source]

Shortcut for checking if the user is a secretary

apps.healthperson.utils.is_allowed_manager(user)[source]

Shortcut for checking if the user is a manager

apps.healthperson.utils.is_allowed_manager_and_secretary(user)[source]

Shortcut for checking if the user is a manager or secretary

apps.healthperson.utils.is_allowed_manager_and_healthprofessional(user)[source]

Shortcut for checking if the user is a manager or healthprofessional

apps.healthperson.utils.is_allowed_healthprofessional(user)[source]

Shortcut for checking if the user is an healthprofessional

apps.healthperson.utils.is_allowed_patient_admins(user)[source]

Shortcut for checking if the user is a manager, secretary or healthprofessional