Set User Roles In User Extensions

Hi,

In Yii I am doing a small application. Where my database is something like this





==================================

|           mspl_sales            |

 ==================================

+     id (pk)                     +

+     product_id (fk)             +

+     store_id (fk)               +

+     discount_id (fk)            +

+   agent_id (fk)                 +

+   date (datetime)               +

+   price (float)                 +

+   discount_percentage (float)   +

+   created_by(int)               +

+   updated_by(int)               +

+   created_at(datetime)          +

+   updated_at(datetime)          +

+++++++++++++++++++++++++++++++++++




=====================================

        mspl_requistitations

=====================================

+  id (pk)                            +

+  store_id (fk)                      +

+  product_id (fk)                    +

+  agent_id (fk)                      +

+  date (datetime)                    +

+  requisition_number  (varchar(45))  +

+  procure_quantity  (varchar(45))    +

+  balance_store_stock (varchar(45))  +

+  priority (varchar(45))             +

+  created_by (int)                   +

+  updated_by (int)                   +

+  created_at (datetime)              +

+  updated_at (datetime)              +

++++++++++++++++++++++++++++++++++++++







===============================

         mspl_products

===============================

+  id (pk)                     +

+  product_name (varchar(45))  +

+  cost_price (float)          +

+  selling_price  (float)       +

+  created_by (int)            +

+  updated_by (int)            +

+  created_at (datetime)       +

+  updated_at (datetime)       +

+++++++++++++++++++++++++++++++




==============================

        mspl_stores

==============================

+   id(pk)                    +

+   store_name (varchar(45))  +

+   store_locationn (varchar(45))+

+  created_by (int)            +

+  updated_by (int)            +

+  created_at (datetime)       +

+  updated_at (datetime)       +

++++++++++++++++++++++++++++++++


================================

    mspl_discounts

================================

+  id (pk)                     +

+  discount_type (varchar(45))  +

+  created_by (int)            +

+  updated_by (int)            +

+  created_at (datetime)       +

+  updated_at (datetime)       +

+++++++++++++++++++++++++++++++


=========================================

      mspl_agents

=========================================

+    id (pk)                             +

+    user_name (varchar(45))             +

+    email_id (varchar(45))              +

+    agent_code (varchar(45))            +

+    authorization_password (varchar(45))+

+    created_by (int)                    +

+    updated_by(int)                     +

+    created_at(datetime)                +

+    updated_at(datetime)                +

++++++++++++++++++++++++++++++++++++++++++



For user I have taken yii user extensions. But as per my application requirement I need two kinds of roles.One for the admin where he should have access for every forms and table(CRUD) and another role for agent where he will have only access to mspl_requistitations(CRUD).

So can someone kindly tell me how to set the roles to the user modules for this two kind of roles? Any help and suggestions will be really appreaciable. Thanks

[size=2]SO, here are few options for you.[/size]

Simple RBAC

Rights Extension

Or read this article for better understanding for authorization authentication in yii.

i hope it would be helpful for you.

use yii user + rights

http://www.yiiframework.com/extension/rights/

follow the wiki

http://www.yiiframework.com/wiki/423/installing-yii-users-and-rights-to-newly-created-yii-app/

@rajith you have written a very useful article.:) its a good enough to complete user management module for any application with in a short time.thanks again for that article. ;)

thank you :) ‘+’ it <_< hehe

i did ;)

<_< thank you!! i mean the article!!

Ahh :D i’ll do…by the mean while if you have time then can you check my comment on your project open school. :)