async function addPermissionToRoleHelper(connection, config) {
    const permission = await connection('permissions').where({
        name: config.permission
    }).first();

    if (!permission) {
        throw new errors.InternalServerError({
            message: tpl(messages.permissionRoleActionError, {
                action: 'add',
                permission: config.permission,
                role: config.role,
                resource: 'permission'
            })
        });
    }

    const role = await connection('roles').where({
        name: config.role
    }).first();

    if (!role) {
        throw new errors.InternalServerError({
            message: tpl(messages.permissionRoleActionError, {
                action: 'add',
                permission: config.permission,
                role: config.role,
                resource: 'role'
            })
        });
    }

    const existingRelation = await connection('permissions_roles').where({
        permission_id: permission.id,
        role_id: role.id
    }).first();

    if (existingRelation) {
        logging.warn(`Adding permission(${config.permission}) to role(${config.role}) - already exists`);
        return;
    }

    logging.info(`Adding permission(${config.permission}) to role(${config.role})`);
    await connection('permissions_roles').insert({
        id: ObjectId().toHexString(),
        permission_id: permission.id,
        role_id: role.id
    });
}
@param {import('knex').Knex} connection
@param {PermissionRoleConfig} config