How to use the ramp-database.ramp_database.tools.user.approve_user function in ramp-database

To help you get started, we’ve selected a few ramp-database examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github paris-saclay-cds / ramp-board / ramp-database / ramp_database / testing.py View on Github external
Parameters
    ----------
    session : :class:`sqlalchemy.orm.Session`
        The session to directly perform the operation on the database.
    """
    add_user(
        session, name='test_user', password='test',
        lastname='Test', firstname='User',
        email='test.user@gmail.com', access_level='asked')
    approve_user(session, 'test_user')
    add_user(
        session, name='test_user_2', password='test',
        lastname='Test_2', firstname='User_2',
        email='test.user.2@gmail.com', access_level='user')
    approve_user(session, 'test_user_2')
    add_user(
        session, name='test_iris_admin', password='test',
        lastname='Admin', firstname='Iris',
        email='iris.admin@gmail.com', access_level='admin')
github paris-saclay-cds / ramp-board / ramp-database / ramp_database / testing.py View on Github external
def add_users(session):
    """Add dummy users in the database.

    Parameters
    ----------
    session : :class:`sqlalchemy.orm.Session`
        The session to directly perform the operation on the database.
    """
    add_user(
        session, name='test_user', password='test',
        lastname='Test', firstname='User',
        email='test.user@gmail.com', access_level='asked')
    approve_user(session, 'test_user')
    add_user(
        session, name='test_user_2', password='test',
        lastname='Test_2', firstname='User_2',
        email='test.user.2@gmail.com', access_level='user')
    approve_user(session, 'test_user_2')
    add_user(
        session, name='test_iris_admin', password='test',
        lastname='Admin', firstname='Iris',
        email='iris.admin@gmail.com', access_level='admin')
github paris-saclay-cds / ramp-board / ramp-database / ramp_database / cli.py View on Github external
def approve_user(config, login):
    """Approve a user which asked to sign-up to RAMP studio."""
    config = read_config(config)
    with session_scope(config['sqlalchemy']) as session:
        user_module.approve_user(session, login)