Using Credentials to limit menus or functions

Hello all,

Is there a set of best practices to create user credentials that will control what menu items or functions within an app. If it matters, I am focused on a web app running on linux with a PostgreSQL database.

I’ve never done this before so an example or two or a book suggestion would be really helpful!
Thank you,

for a company the users like to have the same user and password.
in windows enviroment you would ask the active directory for login permission / groups.
otherwise if you have your own logins / user table you could use keywords or flags.
in my last app i split by work area, office, external work, developer, admin, guest.
then i had a class with propertys as example can view business charts, can add new locations, can edit users, can print tasks, …
this propertys i used to disable menüs.
means your app know who is the user, it is stored in the session.