geonature.core.users.routes

Attributes

Functions

get_roles_by_menu_id([id_menu])

Returns the list of roles associated with a menu

get_roles_by_menu_code(code_liste)

Returns the list of roles associated with a user list (identified by its code)

get_listes()

get_role(id_role)

Get role detail

get_roles()

Get all roles

get_organismes()

Get all organisms

get_organismes_jdd()

Get all organisms and the JDD where there are actor and where

get_organism(id_organisme)

Get complete organism details by ID

create_organism(→ dict)

Create a new organism

check_sign_up_enabled(key)

Decorator to check if a user management feature is enabled.

inscription()

Add a user to temporary users table from the GeoNature interface

login_recovery()

Send an email with the user login and a link to reset its password

confirmation()

Validate a user account after a request (this action is triggered by the link in the email)

update_role()

Modify the role of the user associated with the current token.

change_password_route()

Change the password of the connected user

new_password()

Changes the password of a user after they requested a password recovery

new_mail()

Send a mail to the user with a link to confirm his new mail address

confirm_new_mail()

Change the email address of the user.

Module Contents

geonature.core.users.routes.routes[source]
geonature.core.users.routes.log[source]
geonature.core.users.routes.s[source]
geonature.core.users.routes.user_fields[source]
geonature.core.users.routes.organism_fields[source]
geonature.core.users.routes.get_roles_by_menu_id(id_menu=None)[source]

Returns the list of roles associated with a menu

Parameters

id_menuint

The id of user list (utilisateurs.bib_list)

nom_completstr, optional

Beginning of complete name of the role

GET parameters

param id_menu:

the id of user list (utilisateurs.bib_list)

type id_menu:

int

query str nom_complet:

beginning of complet name of the role

geonature.core.users.routes.get_roles_by_menu_code(code_liste)[source]

Returns the list of roles associated with a user list (identified by its code)

Parameters

code_listestr

The code of user list (utilisateurs.t_lists)

nom_completstr, optional

Beginning of complete name of the role, default None

Returns

list

A list of roles associated with the user list

geonature.core.users.routes.get_listes()[source]
geonature.core.users.routes.get_role(id_role)[source]

Get role detail

Parameters

id_roleint

the id user

Returns

dict

A dictionary containing the role detail

geonature.core.users.routes.get_roles()[source]

Get all roles

geonature.core.users.routes.get_organismes()[source]

Get all organisms

geonature.core.users.routes.get_organismes_jdd()[source]

Get all organisms and the JDD where there are actor and where the current user hase autorization with its cruved

geonature.core.users.routes.get_organism(id_organisme)[source]

Get complete organism details by ID

Returns:

dict: Complete organism information including all fields

geonature.core.users.routes.create_organism() dict[source]

Create a new organism

Request body should contain: - nom_organisme (required): organism name - adresse_organisme (optional): address - cp_organisme (optional): postal code - ville_organisme (optional): city - tel_organisme (optional): telephone - fax_organisme (optional): fax - email_organisme (optional): email - url_organisme (optional): website URL - url_logo (optional): logo URL

Returns:

dict: The created organism with its ID

geonature.core.users.routes.check_sign_up_enabled(key)[source]

Decorator to check if a user management feature is enabled.

Parameters

keystr

The key of the feature. Must be one of: ENABLE_SIGN_UP, ENABLE_ACCOUNT_MANAGEMENT, AUTO_ACCOUNT_CREATION

geonature.core.users.routes.inscription()[source]

Add a user to temporary users table from the GeoNature interface Works according to the “ENABLE_SIGN_UP” authorization in the config.

geonature.core.users.routes.login_recovery()[source]

Send an email with the user login and a link to reset its password Only works if “ENABLE_SIGN_UP” is enabled

geonature.core.users.routes.confirmation()[source]

Validate a user account after a request (this action is triggered by the link in the email) Create a personal JDD as post_action if the parameter AUTO_DATASET_CREATION is set to True

geonature.core.users.routes.update_role()[source]

Modify the role of the user associated with the current token.

geonature.core.users.routes.change_password_route()[source]

Change the password of the connected user

geonature.core.users.routes.new_password()[source]

Changes the password of a user after they requested a password recovery Requires a token sent by mail to the user

geonature.core.users.routes.new_mail()[source]

Send a mail to the user with a link to confirm his new mail address

geonature.core.users.routes.confirm_new_mail()[source]

Change the email address of the user.

Notes

Not required but this route is meant to be called after the new mail route.