As noted in the comments of the article you linked, if you’re using a custom table prefix you’ll need to amend the code appropriately:
For those who encounter “You do not have sufficient permissions to access this page.”, replace “wp_capabilities” with your full wordpress table name, e.g. if your usermeta tables are called wp_yourtableusermeta (as opposed to wp_usermeta in this tutorial), then you need to use wp_yourtablecapabilities instead. Same goes for wp_user_level, change it to wp_yourtableuser_level. Hope this helps.
Yep thanks for the response didn’t read the comments prior to posting