src/dirbs/partition_utils.py
def _grant_perms_association_list(conn, *, part_name):
    """
    Method to DRY out granting of permissions to device association list partitions.

    Arguments:
        conn: dirbs db connection object
        part_name: name of the partition
    """
    with conn.cursor() as cursor:
        part_id = sql.Identifier(part_name)
        cursor.execute(sql.SQL('GRANT SELECT ON {0} TO dirbs_core_classify, dirbs_core_api').format(part_id))
        cursor.execute(sql.SQL('GRANT SELECT, INSERT, UPDATE ON {0} TO dirbs_core_import_device_association_list')
                       .format(part_id))

    Method to DRY out granting of permissions to device association list partitions.

    Arguments:
        conn: dirbs db connection object
        part_name: name of the partition
    
Method to DRY out granting of permissions to device association list partitions.
Method to DRY out granting of permissions to device association list partitions .
def _grant_perms_association_list(conn, *, part_name):
    with conn.cursor() as cursor:
        part_id = sql.Identifier(part_name)
        cursor.execute(sql.SQL('GRANT SELECT ON {0} TO dirbs_core_classify, dirbs_core_api').format(part_id))
        cursor.execute(sql.SQL('GRANT SELECT, INSERT, UPDATE ON {0} TO dirbs_core_import_device_association_list')
                       .format(part_id))
def _grant_perms_association_list ( conn , * , part_name ) : with conn . cursor ( ) as cursor : part_id = sql . Identifier ( part_name ) cursor . execute ( sql . SQL ( 'GRANT SELECT ON {0} TO dirbs_core_classify, dirbs_core_api' ) . format ( part_id ) ) cursor . execute ( sql . SQL ( 'GRANT SELECT, INSERT, UPDATE ON {0} TO dirbs_core_import_device_association_list' ) . format ( part_id ) )
Method to DRY out granting of permissions to device association list partitions.
Method to DRY out granting of permissions to device association list partitions .
"""
    Method to DRY out granting of permissions to device association list partitions.

    Arguments:
        conn: dirbs db connection object
        part_name: name of the partition
    """
conn
dirbs db connection object
dirbs db connection object
part_name
name of the partition
name of the partition