1

I have three tables in the db. One is authmanager has rolename and user_id. The second is user which has the usual id, username and password. The third table is employee, which has 'id', 'user_id' and the rest of the fields. The problem is that in the index page of employee i want to show the employees in tabs and according to the roles in the 'authmanager' table. How can the relations of yii be used?

I am using rights for managing rights and authasignments. I want to get all the users belonging specific rolename. So far i get existing roles with the help of Rights::getAssignedRoles(). I am new to rights so please give me a direction to work.

Afnan Bashir
  • 7,319
  • 20
  • 76
  • 138
  • Are you asking for model relations or to how to retrive the data? If so, please add the relations on each model please. – Skatox Mar 29 '13 at 16:55
  • You are using 3 tables to manage 1 simple logic, IMO you should use 1 table with user (id, username, password, role), and resolve authorization without relations. – Mariano Argañaraz Apr 12 '13 at 02:54
  • When talking about rights, do you mean the [Rights extension](http://www.yiiframework.com/extension/rights/)?. – Nikolas Grottendieck Oct 29 '13 at 11:56

0 Answers0