PHP IF标签Wordpress

I currently have below, its showing that this template can only be accessed by the inspector role. I want to add multi role to this. What would be the best option.

if ( !current_user_can ('inspector')) {
    get_template_part('error');
    exit(0);
}

I'm not entirely sure that I understand the question, but this will show the error template if the user is not an inspector or admin. You can chain as many && together as you need for each role.

if ( !current_user_can ('inspector') && !current_user_can('admin')) {
    get_template_part('error');
    exit(0);
}