Quick Question Regards Data Access

Hi I have a quick Question.

I have developed a simple Database with a crud front end using Yii(obviously). Say for example i have 2 tables in said database,

Table 1: Broker_Details with Columns Broker_id(pk) and Client_id

Table 2: Client_Details with Columns Broker_id and Client_id(pk)

What i want to do is when a broker logs in all he can see is his clients and none others, Also all he can do is view the details and not edit any.

The Client has no interaction at all with the database.

My question is can you point me in the right direction to a tutorial/Information for this or give me a few tips to get this done.

Thanks in advance


Here’s a good tutorial to get started with authentication, authorization:

To disallow someone from viewing a certain action you can can check the accessRules() function (If you can a CRUD generator controller)

		array('allow', // allow authenticated user to perform 'create' and 'update' actions

			'actions'=>array('create','update', 'view'),



‘users’ = array(’@’) means only authenticated users and in the actions array i have specified the ‘view’ action which will only be available to the logged in users (in your case).

Learn more about it from the tutorial link, its best to learn the basics and do it than to waste time figuring out :)