mySQLi and PHP login system with different permissions
<p>I'm pretty new to PHP and I need to make a login system and I need to check if the user has certain permission, then show something on the page. Let me give a pseudo-code example:</p>

<pre><code>IF USER HAS PERMISSION "CONTACTS" OR USER HAS PERMISSION "ALL"
  SHOW CONTACTS LINK
</code></pre>

<p>I've been using DevDojo's <a href="https://github.com/thedevdojo/php-login-script" rel="nofollow noreferrer">php login script</a>, and I wanted something similar or an adaption of that code with a multi-level system.
I've tried many things here on SO but none of them really fit my needs, I need to use something like <code>if $user-&gt;hasPermission("contacts")</code>. because as I have many features, levels like 1, 2 and etc. won't fit, and admin or not also won't. I'm pretty newbie, so explanation is welcome! Thanks in advance. </p>