如何在PHP中定义用户访问级别[关闭]

I'm working on project where I've to define different user levels so that a user can access only assigned sections.

How can I do this?

you can manage it by define role_id and permissions into a table for example you can create table permission and define relation like :-

user_id role_id module_id view edit delete

1 1(admin) 2(view) 1 1 1

2 2(marketing) 3(user list) 1 0 0

check role permission after user logged in .

Hope this will solve your problem.

give the User a roleid,then you judge the id number