#1
Can someone show me how can I create 3 or more user levels?
Admin, Manager, Supervisor and User

I am using Simple members from module market.

Please
#2
It's a little complicated but not impossible, I think DC might be including this sort of thing in the advanced learning zone.

Trongate was designed to be an open slate for your design needs, so creating something like this is really up to you as the developer. Do you need it to be hierarchy based?
#3
For now I want that all of the pages should be accessible by the admin, which currently is present in the framework.
User should access only some pages.
Managers and supervisor should be able to access the pages that admin decides.

I think Trongate is able to handle this thing without much difficulty. But I don't know how to do that. But I am sure I have to do something with these things.
trongate_user_levels
trongate_users
trongate_tokens
#4
Hello,
So. right now you should have a trongate_user_levels table in the database.
It has Administrator and Member.
Simple way is to create a new table called Roles.
roles
1. administrator
2. manager
3. supervisor
You can use this with the members module to login and getting a token.

Then in your controllers you check and see if user has proper credentials
#5
Hi Freiza,

As I was trying to allude to in my previous post, you can manage this anyway that makes you feel good. It's very open to the design you want to create.

Dan's suggestion is good and you could expand by making the default new member a very high number, say 200, so any new user needs to be authorised by the admin and assigned a level. add a field called 'user_level' to the Members table with a default of 201.
Then redirect the new member to a page saying your account has been created, pending admin assignment of level of access or something to that affect...

then in Trongate_security.php you create scenarios for each level

And in your members_area you could check if you are logged in then gather user information and act accordingly:

You could then add conditions in your controller to load views based on member levels or add more scenarios or add 'if' statements in your view files to display content based on a user_levels or groups (just be mindful not to add too much logic to your view files, as some consider it as bad practice)

I also suggest you watch the member's video DC did from the start or jump to 6:20
https://youtu.be/v6Mc3e5SXOM?t=380

hope that helps ?

cheers,
Simon
#6
Dan, Sorry.
#7
That's ok. Glad you found a solution