<?php
function is_superadmin() {
    return $this->session->userdata('role') === 'superadmin';
}

function is_admin_opd() {
    return in_array($this->session->userdata('role'), ['admin_opd', 'superadmin']);
}

function is_user() {
    return $this->session->userdata('role') === 'user';
}

function can_edit_dialog($created_by_role) {
    return is_superadmin() || ($created_by_role === 'admin_opd' && is_admin_opd());
}