<?php

namespace App\Libraries;

class AuthLibrary {
    public function checkAccess($role_diizinkan = []) {
        $session = session();
        if (!$session->has('id_user')) return false;
        
        if (!empty($role_diizinkan) && !in_array($session->get('id_role'), $role_diizinkan)) {
            return false;
        }
        return true;
    }
}