Difference between #2 and #3 of
Simple access control

Changes

Title unchanged

Simple access control

Category unchanged

Tutorials

Yii version unchanged

Tags unchanged

simple, access, control, accessControl, accessRules, allow, deny, user, users

Content changed

For those who feel, the Controller->accessRules() or RBAC (Role-Based Access Control) is too complicated or lengthily to codedoesn't want the username(s) to be hard-coded in accessRules(), here is a very simple, easy-to-implement solution.

Considerations
--------------
As usual, you will have a table, holding the user's data, such as: username, password, email, real_name, etc. To store the user rights, you need an additional field, named **admin_level**. This will be an unsigned tinyint, and will hold the user's rights to do things around the site.
You will define the admin levels, according to your needs. Now, for this example, let's define 4 levels:
[...]
3 7
10 followers
Viewed: 46 761 times
Version: 1.1
Category: Tutorials
Written by: szfjozsef
Last updated by: szfjozsef
Created on: Jun 18, 2012
Last updated: 12 years ago
Update Article

Revisions

View all history