User Creation¶
users_controller.py¶
-
parseUsersFile(importDirectory, expiration=365)[source]¶ Creates new user in the graph database and corresponding node, through the following steps:
Generates new user identifier
Checks if a user with given properties already exists in the database. If not:
Creates new local user (access to graph database)
Saves data to tab-delimited file.
-
get_user_creation_queries()[source]¶ Reads the YAML file containing the queries relevant to user creation, parses the given stream and returns a Python object (dict[dict]).
-
get_new_user_identifier(driver)[source]¶ Queries the database for the last user identifier and returns a new sequential identifier.
- Parameters
driver (py2neo driver) – py2neo driver, which provides the connection to the neo4j graph database.
- Returns
User identifier.
- Return type
-
check_if_node_exists(driver, node_property, value)[source]¶ Queries the graph database and checks if a node with a specific property and property value already exists.
- Parameters
- Returns
Pandas dataframe with user identifier if User with node_property and value already exists, if User does not exist, returns and empty dataframe.
-
create_db_user(driver, data)[source]¶ Creates and assigns role to new graph database user, if user not in list of local users.
- Parameters
driver (py2neo driver) – py2neo driver, which provides the connection to the neo4j graph database.
data (Series) – pandas Series with required user information (see set_arguments()).