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:
IF USER HAS PERMISSION "CONTACTS" OR USER HAS PERMISSION "ALL"
SHOW CONTACTS LINK
I've been using DevDojo's php login script, 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 if $user->hasPermission("contacts")
. 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.