src/dirbs/utils.py
def is_db_user_dirbs_role(conn, role_name):
    """
    Function to test whether the current DB user is in a DIRBS role.

    Arguments:
        conn: dirbs db connection object
        role_name: role name to test for verification
    Returns:
        bool for confirmation
    """
    with conn.cursor() as cur:
        cur.execute("""SELECT pg_has_role(%s, 'MEMBER')""", [role_name])
        return cur.fetchone()[0]

    Function to test whether the current DB user is in a DIRBS role.

    Arguments:
        conn: dirbs db connection object
        role_name: role name to test for verification
    Returns:
        bool for confirmation
    
Function to test whether the current DB user is in a DIRBS role.
Function to test whether the current DB user is in a DIRBS role .
def is_db_user_dirbs_role(conn, role_name):
    with conn.cursor() as cur:
        cur.execute("""SELECT pg_has_role(%s, 'MEMBER')""", [role_name])
        return cur.fetchone()[0]
def is_db_user_dirbs_role ( conn , role_name ) : with conn . cursor ( ) as cur : cur . execute ( """SELECT pg_has_role(%s, 'MEMBER')""" , [ role_name ] ) return cur . fetchone ( ) [ 0 ]
Function to test whether the current DB user is in a DIRBS role.
Function to test whether the current DB user is in a DIRBS role .
"""
    Function to test whether the current DB user is in a DIRBS role.

    Arguments:
        conn: dirbs db connection object
        role_name: role name to test for verification
    Returns:
        bool for confirmation
    """
bool for confirmation
bool for confirmation
conn
dirbs db connection object
dirbs db connection object
role_name
role name to test for verification
role name to test for verification