Plugin doesn't show any data when user has viewer permission, but shows data only when the user has admin privilege

I made an extended version for the table plugin offered by grafana, the plugin works normally when the user is an admin but if the user is has only viewer privilege, the plugin doesn’t show any data at all and shows an error (Cannot read property left of undefined). What’s causing this issue?